Interface FileInfo
-
- All Superinterfaces:
NameSupplier
- All Known Subinterfaces:
PlexusIoResource
- All Known Implementing Classes:
AbstractPlexusIoResource
,PlexusIoFileResource
,PlexusIoSymlinkResource
,PlexusIoURLResource
public interface FileInfo extends NameSupplier
An object implementing this interface is passed to the file selector when the methodFileSelector.isSelected(FileInfo)
is invoked. This object provides information about the file to select or deselect.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description InputStream
getContents()
Creates anInputStream
, which may be used to read the files contents.String
getName()
Returns the resources name, which may include path components, like directory names, or something like that.boolean
isDirectory()
Returns, whether theFileInfo
refers to a directory.boolean
isFile()
Returns, whether theFileInfo
refers to a file.boolean
isSymbolicLink()
Returns, whether theFileInfo
refers to a symlink.
-
-
-
Method Detail
-
getName
String getName()
Returns the resources name, which may include path components, like directory names, or something like that. The resources name is expected to be a relative name and the path components must be separated byFile.pathSeparator
- Specified by:
getName
in interfaceNameSupplier
-
getContents
InputStream getContents() throws IOException
Creates anInputStream
, which may be used to read the files contents. This is useful, if the file selector comes to a decision based on the files contents.- Throws:
IOException
-
isFile
boolean isFile()
Returns, whether theFileInfo
refers to a file. This does not necessarily mean that the underlying representation *is* a file on disk, but that this resource represents a file.
-
isDirectory
boolean isDirectory()
Returns, whether theFileInfo
refers to a directory. This does not necessarily mean that the underlying representation *is* a directory on disk, but that this resource represents a directory.
-
isSymbolicLink
boolean isSymbolicLink()
Returns, whether theFileInfo
refers to a symlink. This does not necessarily mean that the underlying representation *is* a symlink on disk, but that this resource represents a symlink. This method will return "false" for java versions prior to java7.
-
-