Class JrtIoFile

  • All Implemented Interfaces:
    IFile

    public class JrtIoFile
    extends Object
    implements IFile
    • Method Detail

      • getFileSystem

        @NotNull
        public FileSystem getFileSystem()
        Description copied from interface: IFile
        Use getFS() instead Note the IFileSystem is per-protocol, in which it differs from FileSystem.
        Specified by:
        getFileSystem in interface IFile
      • getName

        @NotNull
        public String getName()
        Specified by:
        getName in interface IFile
        Returns:
        simply the last name of the file (the furthest one)
      • getPath

        @NotNull
        public String getPath()
        Description copied from interface: IFile
        Returns a path of this file in a file system.
        Specified by:
        getPath in interface IFile
      • isArchive

        public boolean isArchive()
        Specified by:
        isArchive in interface IFile
      • isInArchive

        public boolean isInArchive()
        Specified by:
        isInArchive in interface IFile
        Returns:
        whether the underlying pathname points to an archive file or some of its contents
      • getBundleHome

        public IFile getBundleHome()
        Specified by:
        getBundleHome in interface IFile
        Returns:
        the jar or folder which contains this file
      • createNewFile

        public boolean createNewFile()
        Description copied from interface: IFile
        creates a physical file
        Specified by:
        createNewFile in interface IFile
        Returns:
        whether it is a success
      • mkdirs

        public boolean mkdirs()
        Specified by:
        mkdirs in interface IFile
      • delete

        public boolean delete()
        Description copied from interface: IFile
        FIXME document what happens if one deletes non-empty folder. IoFile seems to force deletion. Is it the contract?
        Specified by:
        delete in interface IFile
        Returns:
        true if the deletion went with a success
      • rename

        public boolean rename​(@NotNull
                              String newName)
        Description copied from interface: IFile
        renames the file at which the instance of this IFile points (if it exists) the file stays under the same directory and changes its name to the newName
        Specified by:
        rename in interface IFile
        Returns:
        true iff success // * @deprecated use IFile.move(IFile)
      • move

        public boolean move​(@NotNull
                            IFile newParent)
        Description copied from interface: IFile
        moves/renames the file at which the instance of this IFile points
        Specified by:
        move in interface IFile
        Returns:
        true iff success
      • setTimeStamp

        public boolean setTimeStamp​(long time)
        Specified by:
        setTimeStamp in interface IFile
      • isReadOnly

        public boolean isReadOnly()
        Specified by:
        isReadOnly in interface IFile
      • findChild

        @NotNull
        public IFile findChild​(@NotNull
                               String name)
        Description copied from interface: IFile
        Immediate child only. Empty name is forbidden. Neither path separators nor archive separators can't present in name
        Specified by:
        findChild in interface IFile
      • getParent

        @Nullable
        public IFile getParent()
        Specified by:
        getParent in interface IFile
        Returns:
        null iff the instance is root and has no parent, the parent folder otherwise
      • isDirectory

        public boolean isDirectory()
        Specified by:
        isDirectory in interface IFile
      • getChildren

        @Nullable
        public List<IFile> getChildren()
        Specified by:
        getChildren in interface IFile
        Returns:
        the children of this file in case when it is a folder, null iff it is a file and therefore has no children
      • lastModified

        public long lastModified()
        Description copied from interface: IFile
        fixme if it is the same as in java.io.File then we need to enforce it
        Specified by:
        lastModified in interface IFile
      • length

        public long length()
        Specified by:
        length in interface IFile
      • exists

        public boolean exists()
        Specified by:
        exists in interface IFile