Annotation Type PathAware


  • @Target(TYPE)
    @Retention(RUNTIME)
    public @interface PathAware
    Feature annotation to mark a transfer manager of transfer plugins that need to be sub-foldered. This feature adds sub folders to some RemoteFile storage paths in the backend for the purpose of limiting the per-folder file count.

    This is especially critical if the backend storage has a limit on how many files can be stored in a single folder, e.g. the Dropbox plugin can only store 25,000 files in one folder.

    This annotation is only recognized if used on a TransferManager. If applied, it wraps the original transfer manager in a PathAwareFeatureTransferManager, which defines details for the subfoldering, such as the depths of the subfolders, the path separator or other relevant settings.

    The only mandatory configuration for this feature is specifying a PathAwareFeatureExtension to manage the required subfolders (creating, deleting, listing). It must be implemented by the transfer plugin.

    Example: If the subfolderDepth() is 2, the bytesPerFolder() is 1, and the folderSeparator() is '/', a multichunk file might be located at 'multichunks/e3/5f/multichunk-e35f0d48060...' instead of 'multichunks/multichunk-e35f0d4806...'.

    See Also:
    PathAwareFeatureTransferManager, PathAwareFeatureExtension, PathAwareFeatureTransferManager.PathAwareRemoteFileAttributes
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      java.lang.Class<? extends PathAwareFeatureExtension> extension
      The path aware extension must be specified to manage the required subfolders (creating, deleting, listing).
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.Class<? extends RemoteFile>[] affected
      Defines the remote file classes to be affected by the subfoldering.
      int bytesPerFolder
      Defines the bytes of the subfolder identifier used for the subfolders.
      char folderSeparator
      Defines the separator used to complete the folder paths.
      int subfolderDepth
      Defines the depth of the subfolders to be created.
    • Element Detail

      • extension

        java.lang.Class<? extends PathAwareFeatureExtensionextension
        The path aware extension must be specified to manage the required subfolders (creating, deleting, listing).
      • subfolderDepth

        int subfolderDepth
        Defines the depth of the subfolders to be created. The higher the depth, the bigger the overhead required for managing the subfolders.
        Default:
        2
      • bytesPerFolder

        int bytesPerFolder
        Defines the bytes of the subfolder identifier used for the subfolders. If the bytes per folder is 2 (and the subfolder depth is 2), a multichunk might be located at 'multichunks/e35f/0d48/multichunk-e35f0d4...'.
        Default:
        1
      • folderSeparator

        char folderSeparator
        Defines the separator used to complete the folder paths.
        Default:
        '/'
      • affected

        java.lang.Class<? extends RemoteFile>[] affected
        Defines the remote file classes to be affected by the subfoldering. Do not change the default unless you know what you are doing.
        Default:
        {org.syncany.plugins.transfer.files.MultichunkRemoteFile.class, org.syncany.plugins.transfer.files.TempRemoteFile.class}