Class TemporaryFileProvider
- java.lang.Object
-
- org.apache.commons.vfs2.provider.AbstractVfsComponent
-
- org.apache.commons.vfs2.provider.AbstractVfsContainer
-
- org.apache.commons.vfs2.provider.AbstractFileProvider
-
- org.apache.commons.vfs2.provider.temp.TemporaryFileProvider
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,java.lang.Comparable<java.lang.Object>
,FileProvider
,VfsComponent
public class TemporaryFileProvider extends AbstractFileProvider implements java.lang.Comparable<java.lang.Object>
A provider for temporary files.
-
-
Constructor Summary
Constructors Constructor Description TemporaryFileProvider()
Constructs a new instance.TemporaryFileProvider(java.io.File rootFile)
Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(java.lang.Object o)
FileObject
findFile(FileObject baseFile, java.lang.String uri, FileSystemOptions fileSystemOptions)
Locates a file object, by absolute URI.java.util.Collection<Capability>
getCapabilities()
Gets the file system capabilities.-
Methods inherited from class org.apache.commons.vfs2.provider.AbstractFileProvider
addFileSystem, close, closeFileSystem, createFileSystem, findFileSystem, freeUnusedResources, getConfigBuilder, getFileNameParser, parseUri, setFileNameParser
-
Methods inherited from class org.apache.commons.vfs2.provider.AbstractVfsContainer
addComponent, removeComponent
-
Methods inherited from class org.apache.commons.vfs2.provider.AbstractVfsComponent
getContext, getLogger, init, setContext, setLogger
-
-
-
-
Constructor Detail
-
TemporaryFileProvider
public TemporaryFileProvider()
Constructs a new instance.
-
TemporaryFileProvider
public TemporaryFileProvider(java.io.File rootFile)
Constructs a new instance.- Parameters:
rootFile
- The root file.
-
-
Method Detail
-
compareTo
public int compareTo(java.lang.Object o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<java.lang.Object>
-
findFile
public FileObject findFile(FileObject baseFile, java.lang.String uri, FileSystemOptions fileSystemOptions) throws FileSystemException
Locates a file object, by absolute URI.- Specified by:
findFile
in interfaceFileProvider
- Parameters:
baseFile
- The base FileObject.uri
- The URI of the file to be located.fileSystemOptions
- FileSystemOptions to use to locate or create the file.- Returns:
- The FileObject.
- Throws:
FileSystemException
- if an error occurs.
-
getCapabilities
public java.util.Collection<Capability> getCapabilities()
Description copied from interface:FileProvider
Gets the file system capabilities.These are the same as on the file system, but available before the first file system was instantiated.
- Specified by:
getCapabilities
in interfaceFileProvider
- Returns:
- a Collection of the file systems Capabilities.
-
-