java.lang.Object
com.aoapps.io.filesystems.TempFileSystem
- All Implemented Interfaces:
- FileSystem
A temporary file system stored in the Java heap.
- Author:
- AO Industries, Inc.
- 
Nested Class SummaryNested Classes
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidcheckSubPath(Path parent, String name) Temporary file systems support all possible paths.createDirectory(Path path) Atomically creates a directory (must not have already existed).createFile(Path path) Atomically creates an empty file (must not have already existed).voidDeletes the file system object at the given path.Lists the children of the given path in no specific order.Locks a file in exclusive mode.longGets the size of the file system object at the given path.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.aoapps.io.filesystems.FileSystemjoin, parsePath
- 
Field Details- 
files
 
- 
- 
Constructor Details- 
TempFileSystempublic TempFileSystem()Creates a new temp filesystem.
 
- 
- 
Method Details- 
checkSubPathTemporary file systems support all possible paths.- Specified by:
- checkSubPathin interface- FileSystem
- Parameters:
- name- The path to check, must be from this file system.
 
- 
listDescription copied from interface:FileSystemLists the children of the given path in no specific order. It is possible that paths may be returned that no longer exist. It is also possible that new file system objects created after the beginning of iteration are not returned.- Specified by:
- listin interface- FileSystem
- Parameters:
- path- Must be from this file system.
- Returns:
- a read-only iterator of children
- Throws:
- NoSuchFileException- if the path does not exist
- NotDirectoryException- if the path is not a directory
 
- 
deleteDescription copied from interface:FileSystemDeletes the file system object at the given path.- Specified by:
- deletein interface- FileSystem
- Parameters:
- path- Must be from this file system.
 
- 
sizeDescription copied from interface:FileSystemGets the size of the file system object at the given path.- Specified by:
- sizein interface- FileSystem
- Parameters:
- path- Must be from this file system.
 
- 
createFileDescription copied from interface:FileSystemAtomically creates an empty file (must not have already existed).- Specified by:
- createFilein interface- FileSystem
- Returns:
- returns the path
 
- 
createDirectoryDescription copied from interface:FileSystemAtomically creates a directory (must not have already existed).- Specified by:
- createDirectoryin interface- FileSystem
- Returns:
- returns the path
 
- 
lockDescription copied from interface:FileSystemLocks a file in exclusive mode. File range and shared locks not currently supported. The lock must be closed to unlock, usually in a try/finally or try-with-resources block. The locks are not reentrant, attempting to obtain the lock from the same thread will result in deadlock.- Specified by:
- lockin interface- FileSystem
- See Also:
 
 
- 

