Klasse FileSystemItemAccessor

java.lang.Object
ch.nolix.core.environment.filesystem.FileSystemItemAccessor
Bekannte direkte Unterklassen:
FileAccessor, FolderAccessor

public class FileSystemItemAccessor extends Object
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
  • Konstruktordetails

    • FileSystemItemAccessor

      public FileSystemItemAccessor(String path)
      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

      public final String getExtension()
      Gibt zurück:
      the extension of the name of the file system item of the current FileSystemItemAccessor.
    • getName

      public final String getName()
      Gibt zurück:
      the name of the file system item of the current FileSystemItemAccessor.
    • getParentFolderAccessor

      public final FolderAccessor getParentFolderAccessor()
      Gibt zurück:
      a new folder accessor to the parent folder of the file system item of this file system item accessor.
    • getPath

      public final String getPath()
      Gibt zurück:
      the path of the file system item of this file system item accessor.
    • hasExtension

      public final boolean hasExtension(String extension)
      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

      protected final File getInternalAccessor()
      Gibt zurück:
      the internal accessor of this file system item accessor.