Klasse FileSystemItemAccessor
java.lang.Object
ch.nolix.core.environment.filesystem.FileSystemItemAccessor
- Bekannte direkte Unterklassen:
FileAccessor
,FolderAccessor
A file system item accessor can access a given file system item. A file
system item is a file or a folder.
- Version:
- 2017-07-10
- Autor:
- Silvan Wyss
-
Konstruktorübersicht
KonstruktorBeschreibungFileSystemItemAccessor
(String path) Creates a new file system accessor for the file system item with the given path. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungfinal String
protected final File
final String
getName()
final FolderAccessor
final String
getPath()
long
final boolean
hasExtension
(String extension) final boolean
isFile()
final boolean
isFolder()
final void
Opens the parent folder of the file system item of this file system item accessor in the file explorer.
-
Konstruktordetails
-
FileSystemItemAccessor
Creates a new file system accessor for the file system item with the given path.- Parameter:
path
-- Löst aus:
InvalidArgumentException
- if there does not exist a file system item with the given path in the file system on the local machine.
-
-
Methodendetails
-
getExtension
- Gibt zurück:
- the extension of the name of the file system item of the current
FileSystemItemAccessor
.
-
getName
- Gibt zurück:
- the name of the file system item of the current
FileSystemItemAccessor
.
-
getParentFolderAccessor
- Gibt zurück:
- a new folder accessor to the parent folder of the file system item of this file system item accessor.
-
getPath
- Gibt zurück:
- the path of the file system item of this file system item accessor.
-
hasExtension
- Parameter:
extension
-- Gibt zurück:
- true if the file system item of the current
FileSystemItemAccessor
has the given extension.
-
getSizeInBytes
public long getSizeInBytes()- Gibt zurück:
- the size of the file system item of this file system item accessor in bytes.
-
isFile
public final boolean isFile()- Gibt zurück:
- true if the file system item is a file in the file system on the local machine.
-
isFolder
public final boolean isFolder()- Gibt zurück:
- true if this path is a folder in the file system on the local machine.
-
openParentFolder
public final void openParentFolder()Opens the parent folder of the file system item of this file system item accessor in the file explorer. -
getInternalAccessor
- Gibt zurück:
- the internal accessor of this file system item accessor.
-