Class GenericFileHelper

java.lang.Object
org.apache.camel.component.file.GenericFileHelper

public final class GenericFileHelper extends Object
  • Method Details

    • jailToLocalWorkDirectory

      public static void jailToLocalWorkDirectory(File target, File localWorkDirectory)
      Ensures the resolved local work file stays within the configured local work directory. The remote file name used to build the local work file path may contain ../ sequences that would otherwise resolve to a path outside the work directory.
      Parameters:
      target - the resolved local work file (or its in-progress temp file)
      localWorkDirectory - the local work directory the file must stay within
      Throws:
      GenericFileOperationFailedException - if the target resolves outside the local work directory
    • asExclusiveReadLockKey

      public static String asExclusiveReadLockKey(GenericFile file, String key)
    • asExclusiveReadLockKey

      public static String asExclusiveReadLockKey(String path, String key)
    • createDummy

      public static <T> org.apache.camel.Exchange createDummy(GenericFileEndpoint<T> endpoint, org.apache.camel.Exchange dynamic, Supplier<GenericFile<T>> file)