Package de.xima.fc.gui.elfinder
Class DefaultElFinderFileSystemOptionsProvider<Entry extends IFileSystemEntry<?>>
- java.lang.Object
-
- de.xima.fc.gui.elfinder.DefaultElFinderFileSystemOptionsProvider<Entry>
-
- Type Parameters:
Entry
- Common super type of all file system entries.
- All Implemented Interfaces:
IElFinderFileSystemOptionsProvider<Entry>
,Serializable
public class DefaultElFinderFileSystemOptionsProvider<Entry extends IFileSystemEntry<?>> extends Object implements IElFinderFileSystemOptionsProvider<Entry>
Implementation ofIElFinderFileSystemOptionsProvider
that provides defaults for all settings. You can override each method to provide custom settings.- Since:
- 8.3.0
- Author:
- XIMA MEDIA GmbH
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DefaultElFinderFileSystemOptionsProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canDetectUpdateByTimestamp(String volume, ICommonFileSystemManager<Entry> fileSystemManager)
Whether the file system of the given volume supports detecting updates by comparing the timestamp of the file or directory with the last known modification timestamp.boolean
canRead(Entry entry, ICommonFileSystemManager<Entry> fileSystemManager)
Whether the file or directory can be read.boolean
canWrite(Entry entry, ICommonFileSystemManager<Entry> fileSystemManager)
Whether the file or directory can be written to.String
cssClass(Entry entry, ICommonFileSystemManager<Entry> fileSystemManager)
Gets the optional CSS class for the file or directory.Set<String>
disabledCommands(String volume, ICommonFileSystemManager<Entry> fileSystemManager)
Gets a list of commands not allowed on the given volume.String
displayName(Entry entry, ICommonFileSystemManager<Entry> fileSystemManager, Locale locale)
Gets the name of the given entry.String
filePathSeparator(String volume, ICommonFileSystemManager<Entry> fileSystemManager)
Separator for file paths in the file system for a given volume.int
jpegQuality(Entry entry, ICommonFileSystemManager<Entry> fileSystemManager)
Gets the quality of JPEG images when resizing, cropping, or rotating JPEG images.boolean
localizeDirectoryName(String volume, ICommonFileSystemManager<Entry> fileSystemManager)
Whether to localize the directory name in the elFinder UI.boolean
locked(Entry entry, ICommonFileSystemManager<Entry> fileSystemManager)
Whether the file or directory is locked and cannot be modified.boolean
overwriteExistingFilesOnCopy(String volume, ICommonFileSystemManager<Entry> fileSystemManager)
Whether to overwrite files with the same name on the given volume when copying files.boolean
overwriteExistingFilesOnUpload(String volume, ICommonFileSystemManager<Entry> fileSystemManager)
Whether to overwrite files with the same name on the given volume when uploading files.
-
-
-
Method Detail
-
canDetectUpdateByTimestamp
public boolean canDetectUpdateByTimestamp(String volume, ICommonFileSystemManager<Entry> fileSystemManager)
Description copied from interface:IElFinderFileSystemOptionsProvider
Whether the file system of the given volume supports detecting updates by comparing the timestamp of the file or directory with the last known modification timestamp. Corresponds to thesyncChkAsTs
settings from elFinder.- Specified by:
canDetectUpdateByTimestamp
in interfaceIElFinderFileSystemOptionsProvider<Entry extends IFileSystemEntry<?>>
- Parameters:
volume
- The volume of the file system.fileSystemManager
- The current file system manager.- Returns:
- Whether the file system supports detecting updates by timestamp.
-
canRead
public boolean canRead(Entry entry, ICommonFileSystemManager<Entry> fileSystemManager)
Description copied from interface:IElFinderFileSystemOptionsProvider
Whether the file or directory can be read.- Specified by:
canRead
in interfaceIElFinderFileSystemOptionsProvider<Entry extends IFileSystemEntry<?>>
- Parameters:
entry
- The file or directory.fileSystemManager
- The current file system manager.- Returns:
- Whether the file or directory can be read.
-
canWrite
public boolean canWrite(Entry entry, ICommonFileSystemManager<Entry> fileSystemManager)
Description copied from interface:IElFinderFileSystemOptionsProvider
Whether the file or directory can be written to.- Specified by:
canWrite
in interfaceIElFinderFileSystemOptionsProvider<Entry extends IFileSystemEntry<?>>
- Parameters:
entry
- The file or directory.fileSystemManager
- The current file system manager.- Returns:
- Whether the file or directory can be written to.
-
cssClass
public String cssClass(Entry entry, ICommonFileSystemManager<Entry> fileSystemManager)
Description copied from interface:IElFinderFileSystemOptionsProvider
Gets the optional CSS class for the file or directory. Can be used e.g. to display different icons for different file types.- Specified by:
cssClass
in interfaceIElFinderFileSystemOptionsProvider<Entry extends IFileSystemEntry<?>>
- Parameters:
entry
- The file or directory.fileSystemManager
- The current file system manager.- Returns:
- The optional CSS class for the file or directory. Can be null or empty.
-
disabledCommands
public Set<String> disabledCommands(String volume, ICommonFileSystemManager<Entry> fileSystemManager)
Description copied from interface:IElFinderFileSystemOptionsProvider
Gets a list of commands not allowed on the given volume.- Specified by:
disabledCommands
in interfaceIElFinderFileSystemOptionsProvider<Entry extends IFileSystemEntry<?>>
- Parameters:
volume
- The volume.fileSystemManager
- The current file system manager.- Returns:
- A set of commands not allowed on the given volume.
-
displayName
public String displayName(Entry entry, ICommonFileSystemManager<Entry> fileSystemManager, Locale locale)
Description copied from interface:IElFinderFileSystemOptionsProvider
Gets the name of the given entry. This can be just the file name, or some localized display name.- Specified by:
displayName
in interfaceIElFinderFileSystemOptionsProvider<Entry extends IFileSystemEntry<?>>
- Parameters:
entry
- The file or directory.fileSystemManager
- The current file system manager.locale
- The locale to use for localization.- Returns:
- The display name of the file or directory.
-
filePathSeparator
public String filePathSeparator(String volume, ICommonFileSystemManager<Entry> fileSystemManager)
Description copied from interface:IElFinderFileSystemOptionsProvider
Separator for file paths in the file system for a given volume. Usually "/" or "\".- Specified by:
filePathSeparator
in interfaceIElFinderFileSystemOptionsProvider<Entry extends IFileSystemEntry<?>>
- Parameters:
volume
- The volume of the file system.fileSystemManager
- The current file system manager.- Returns:
- The file path separator.
-
jpegQuality
public int jpegQuality(Entry entry, ICommonFileSystemManager<Entry> fileSystemManager)
Description copied from interface:IElFinderFileSystemOptionsProvider
Gets the quality of JPEG images when resizing, cropping, or rotating JPEG images.- Specified by:
jpegQuality
in interfaceIElFinderFileSystemOptionsProvider<Entry extends IFileSystemEntry<?>>
- Parameters:
entry
- The file entry.fileSystemManager
- The current file system manager.- Returns:
- The quality of JPEG images, between 0 and 100.
-
localizeDirectoryName
public boolean localizeDirectoryName(String volume, ICommonFileSystemManager<Entry> fileSystemManager)
Description copied from interface:IElFinderFileSystemOptionsProvider
Whether to localize the directory name in the elFinder UI. UseselFinderInstance.messages['folder_'+name]
in the client-side JavaScript.- Specified by:
localizeDirectoryName
in interfaceIElFinderFileSystemOptionsProvider<Entry extends IFileSystemEntry<?>>
- Parameters:
volume
- The volume.fileSystemManager
- The current file system manager.- Returns:
- Whether to localize the directory names in that volume.
-
locked
public boolean locked(Entry entry, ICommonFileSystemManager<Entry> fileSystemManager)
Description copied from interface:IElFinderFileSystemOptionsProvider
Whether the file or directory is locked and cannot be modified.- Specified by:
locked
in interfaceIElFinderFileSystemOptionsProvider<Entry extends IFileSystemEntry<?>>
- Parameters:
entry
- The file or directory.fileSystemManager
- The current file system manager.- Returns:
- Whether the file or directory is locked.
-
overwriteExistingFilesOnCopy
public boolean overwriteExistingFilesOnCopy(String volume, ICommonFileSystemManager<Entry> fileSystemManager)
Description copied from interface:IElFinderFileSystemOptionsProvider
Whether to overwrite files with the same name on the given volume when copying files.- Specified by:
overwriteExistingFilesOnCopy
in interfaceIElFinderFileSystemOptionsProvider<Entry extends IFileSystemEntry<?>>
- Parameters:
volume
- The volume.fileSystemManager
- The current file system manager.- Returns:
- Whether to overwrite files with the same name on the given volume when copying files.
-
overwriteExistingFilesOnUpload
public boolean overwriteExistingFilesOnUpload(String volume, ICommonFileSystemManager<Entry> fileSystemManager)
Description copied from interface:IElFinderFileSystemOptionsProvider
Whether to overwrite files with the same name on the given volume when uploading files.- Specified by:
overwriteExistingFilesOnUpload
in interfaceIElFinderFileSystemOptionsProvider<Entry extends IFileSystemEntry<?>>
- Parameters:
volume
- The volume.fileSystemManager
- The current file system manager.- Returns:
- Whether to overwrite files with the same name on the given volume when uploading files.
-
-