gs.hitchin.hitchfs
Class StubFileSystem
java.lang.Object
gs.hitchin.hitchfs.StubFakeFileOperations
gs.hitchin.hitchfs.StubFileSystem
- All Implemented Interfaces:
- FakeFileOperations, FileSystem
- Direct Known Subclasses:
- BasicFileSystem
public class StubFileSystem
- extends StubFakeFileOperations
- implements FileSystem
A stub of a FileSystem for use in testing.
|
Method Summary |
String |
absolute(String path)
|
Iterable<String> |
absoluteSplit(String path)
|
String |
canonical(String path)
|
Iterable<String> |
canonicalSplit(String path)
|
File |
createTempFile(String suffix,
String prefix)
|
File |
createTempFile(String suffix,
String prefix,
File directory)
|
long |
currentTimeMillis()
|
FakeFile |
file(File regular)
|
FakeFile |
file(File parent,
String child)
|
FakeFile |
file(String pathname)
|
FakeFile |
file(String parent,
String child)
|
FakeFile |
file(URI uri)
|
String |
getCurrentDirectory()
|
Iterable<String> |
getCurrentDirectorySplit()
|
FakeFileOperations |
getFileOperations()
|
String |
getPathSeparator()
|
char |
getPathSeparatorChar()
|
String |
getSeparator()
|
char |
getSeparatorChar()
|
InputStream |
input(File file)
|
InputStream |
input(FileDescriptor fdObj)
|
InputStream |
input(String file)
|
boolean |
isAbsolute(String path)
http://www.docjar.com/html/api/java/io/File.java.html |
boolean |
isCaseSensitive()
|
File[] |
listRoots()
|
static String |
makePath(Iterable<String> ps,
String pathDelim,
boolean absolute)
|
OutputStream |
output(File file)
|
OutputStream |
output(File file,
boolean append)
|
OutputStream |
output(FileDescriptor fdObj)
|
OutputStream |
output(String filename)
|
OutputStream |
output(String filename,
boolean append)
|
Reader |
reader(File file)
|
Reader |
reader(FileDescriptor fdObj)
|
Reader |
reader(String filename)
|
FakeFile |
register(FakeFile file)
|
FakeFile |
update(FakeFile file)
Updates the FakeFile with an absolute key based on the current
directory of this file system. |
Writer |
writer(File file)
|
Writer |
writer(File file,
boolean append)
|
Writer |
writer(FileDescriptor fdObj)
|
Writer |
writer(String filename)
|
Writer |
writer(String filename,
boolean append)
|
| Methods inherited from class gs.hitchin.hitchfs.StubFakeFileOperations |
canExecute, canRead, canWrite, compareTo, createNewFile, delete, deleteOnExit, equals, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getFreeSpace, getInputStream, getName, getOutputStream, getParent, getParentFile, getPath, getTotalSpace, getUsableSpace, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listFiles, mkdir, mkdirs, renameTo, setExecutable, setExecutable, setHidden, setLastModified, setReadable, setReadable, setReadOnly, setWritable, setWritable, toString, touch, toURI, toURL |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StubFileSystem
public StubFileSystem()
StubFileSystem
public StubFileSystem(FakeFileOperations operations)
absolute
public String absolute(String path)
absoluteSplit
public Iterable<String> absoluteSplit(String path)
canonical
public String canonical(String path)
canonicalSplit
public Iterable<String> canonicalSplit(String path)
createTempFile
public File createTempFile(String suffix,
String prefix)
throws IOException
- Throws:
IOException
createTempFile
public File createTempFile(String suffix,
String prefix,
File directory)
throws IOException
- Throws:
IOException
currentTimeMillis
public long currentTimeMillis()
file
public FakeFile file(File regular)
- Specified by:
file in interface FileSystem
file
public FakeFile file(File parent,
String child)
- Specified by:
file in interface FileSystem
file
public FakeFile file(String pathname)
- Specified by:
file in interface FileSystem
file
public FakeFile file(String parent,
String child)
- Specified by:
file in interface FileSystem
file
public FakeFile file(URI uri)
- Specified by:
file in interface FileSystem
getCurrentDirectory
public String getCurrentDirectory()
getCurrentDirectorySplit
public Iterable<String> getCurrentDirectorySplit()
getFileOperations
public FakeFileOperations getFileOperations()
getPathSeparator
public String getPathSeparator()
- Specified by:
getPathSeparator in interface FakeFileOperations- Overrides:
getPathSeparator in class StubFakeFileOperations
getPathSeparatorChar
public char getPathSeparatorChar()
- Specified by:
getPathSeparatorChar in interface FakeFileOperations- Overrides:
getPathSeparatorChar in class StubFakeFileOperations
getSeparator
public String getSeparator()
- Specified by:
getSeparator in interface FakeFileOperations- Overrides:
getSeparator in class StubFakeFileOperations
getSeparatorChar
public char getSeparatorChar()
- Specified by:
getSeparatorChar in interface FakeFileOperations- Overrides:
getSeparatorChar in class StubFakeFileOperations
input
public InputStream input(File file)
throws IOException
- Specified by:
input in interface FileSystem
- Throws:
IOException
input
public InputStream input(FileDescriptor fdObj)
- Specified by:
input in interface FileSystem
input
public InputStream input(String file)
throws IOException
- Specified by:
input in interface FileSystem
- Throws:
IOException
isAbsolute
public boolean isAbsolute(String path)
- http://www.docjar.com/html/api/java/io/File.java.html
isCaseSensitive
public boolean isCaseSensitive()
- Specified by:
isCaseSensitive in interface FakeFileOperations- Overrides:
isCaseSensitive in class StubFakeFileOperations
listRoots
public File[] listRoots()
makePath
public static String makePath(Iterable<String> ps,
String pathDelim,
boolean absolute)
output
public OutputStream output(File file)
throws IOException
- Specified by:
output in interface FileSystem
- Throws:
IOException
output
public OutputStream output(File file,
boolean append)
throws IOException
- Specified by:
output in interface FileSystem
- Throws:
IOException
output
public OutputStream output(FileDescriptor fdObj)
- Specified by:
output in interface FileSystem
output
public OutputStream output(String filename)
throws IOException
- Specified by:
output in interface FileSystem
- Throws:
IOException
output
public OutputStream output(String filename,
boolean append)
throws IOException
- Specified by:
output in interface FileSystem
- Throws:
IOException
reader
public Reader reader(File file)
throws IOException
- Specified by:
reader in interface FileSystem
- Throws:
IOException
reader
public Reader reader(FileDescriptor fdObj)
- Specified by:
reader in interface FileSystem
reader
public Reader reader(String filename)
throws IOException
- Specified by:
reader in interface FileSystem
- Throws:
IOException
register
public FakeFile register(FakeFile file)
update
public FakeFile update(FakeFile file)
- Updates the FakeFile with an absolute key based on the current
directory of this file system.
writer
public Writer writer(File file)
throws IOException
- Specified by:
writer in interface FileSystem
- Throws:
IOException
writer
public Writer writer(File file,
boolean append)
throws IOException
- Specified by:
writer in interface FileSystem
- Throws:
IOException
writer
public Writer writer(FileDescriptor fdObj)
- Specified by:
writer in interface FileSystem
writer
public Writer writer(String filename)
throws IOException
- Specified by:
writer in interface FileSystem
- Throws:
IOException
writer
public Writer writer(String filename,
boolean append)
throws IOException
- Specified by:
writer in interface FileSystem
- Throws:
IOException
Copyright © 2012. All Rights Reserved.