Class TrashImpl

  • All Implemented Interfaces:
    Trash

    public class TrashImpl
    extends Object
    implements Trash
    • Constructor Detail

      • TrashImpl

        public TrashImpl​(@NotNull
                         ProjectsPaths projectsPaths)
    • Method Detail

      • moveToTrash

        @Nullable
        public File moveToTrash​(@NotNull
                                File dir,
                                @NotNull
                                String trashDirName)
                         throws IOException
        Description copied from interface: Trash
        Moves the specified dir to trash using the given trashDirName.
        Specified by:
        moveToTrash in interface Trash
        Parameters:
        dir - dir to move
        trashDirName - directory name to use under the trash dir
        Returns:
        resulting trash directory or null if directory specified as a first argument does not exist
        Throws:
        IOException - if move fails or trash dir cannot be created
      • removeFromTrash

        public void removeFromTrash​(@NotNull
                                    String trashDirName)
        Description copied from interface: Trash
        Removes directory with the specified name from the trash.
        Specified by:
        removeFromTrash in interface Trash
        Parameters:
        trashDirName - directory name in trash