1 package net.jaekl.squelch.util;
3 import java.io.ByteArrayInputStream;
5 import java.io.FileNotFoundException;
6 import java.io.InputStream;
8 public class FileMock extends File {
9 private static final long serialVersionUID = 1L;
11 private byte[] m_content;
13 public FileMock(String filename) {
20 public boolean canRead() {
21 return FileUtilMock.mock_getInst().mock_canRead(this);
24 public InputStream mock_openStream() throws FileNotFoundException {
25 if (null == m_content) {
26 throw new FileNotFoundException(this.getAbsolutePath());
28 return new ByteArrayInputStream(m_content);
31 public void mock_setContent(byte[] content) {