Class AbstractFileSystemItemAccessor

java.lang.Object
ch.nolix.base.environment.filesystem.AbstractFileSystemItemAccessor
Direct Known Subclasses:
FileAccessor, FileSystemItemAccessor, FolderAccessor

public abstract class AbstractFileSystemItemAccessor extends Object
A file system item accessor can access a given file system item. A file system item is a file or a folder.
Author:
Silvan Wyss
  • Method Details

    • getExtension

      public final String getExtension()
      Returns:
      the extension of the name of the file system item of the current AbstractFileSystemItemAccessor.
    • getName

      public final String getName()
      Returns:
      the name of the file system item of the current AbstractFileSystemItemAccessor.
    • getParentFolderAccessor

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

      public final String getPath()
      Returns:
      the path of the file system item of this file system item accessor.
    • hasExtension

      public final boolean hasExtension(String extension)
      Parameters:
      extension -
      Returns:
      true if the file system item of the current AbstractFileSystemItemAccessor has the given extension, false otherwise
    • getSizeInBytes

      public final long getSizeInBytes()
      Returns:
      the size of the file system item of this file system item accessor in bytes.
    • isFile

      public final boolean isFile()
      Returns:
      true if the file system item is a file in the file system on the local machine, false otherwise
    • isFolder

      public final boolean isFolder()
      Returns:
      true if this path is a folder in the file system on the local machine, false otherwise