Klasse FileSystemItemAccessorUnit
java.lang.Object
ch.nolix.core.environment.filesystem.FileSystemItemAccessorUnit
- 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
KonstruktorenKonstruktorBeschreibungCreates a new file system accessor for the file system item with the given path. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungfinal Stringprotected final Filefinal StringgetName()final FolderAccessorfinal StringgetPath()longfinal booleanhasExtension(String extension) final booleanisFile()final booleanisFolder()final voidOpens the parent folder of the file system item of this file system item accessor in the file explorer.
-
Konstruktordetails
-
FileSystemItemAccessorUnit
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
FileSystemItemAccessorUnit.
-
getName
- Gibt zurück:
- the name of the file system item of the current
FileSystemItemAccessorUnit.
-
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
FileSystemItemAccessorUnithas 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.
-