java.lang.Object
org.cryptomator.frontend.dokany.adapter.FileUtil

public class FileUtil extends Object
  • Field Details

  • Constructor Details

    • FileUtil

      public FileUtil()
  • Method Details

    • dosAttributesToEnumIntegerSet

      public static EnumIntegerSet<FileAttribute> dosAttributesToEnumIntegerSet(DosFileAttributes attr)
      TODO: support for other attributes ?
      Parameters:
      attr - the DOS file attributes of the java standard API
      Returns:
    • setAttribute

      public static void setAttribute(DosFileAttributeView attrView, FileAttribute attr, boolean value) throws IOException
      Throws:
      IOException
    • convertToGlobPattern

      public static String convertToGlobPattern(String rawWindowsPattern)
      Converts search string expression from the windows kernel to valid glob search patterns

      TODO: maybe both methods should be merged for speed up?

      Parameters:
      rawWindowsPattern - a String that may contain unescaped glob patterns or windows kernel specific search patterns
      Returns:
      the corresponding glob search pattern for a PathMatcher
    • buildOpenOptions

      public static Set<OpenOption> buildOpenOptions(EnumIntegerSet<AccessMask> accessMasks, EnumIntegerSet<FileAccessMask> fileAccessMasks, EnumIntegerSet<FileAttribute> fileAttributes, EnumIntegerSet<CreateOptions> createOptions, CreationDisposition creationDisposition, boolean append, boolean fileExists)
    • toFileTime

      public static Optional<FileTime> toFileTime(com.sun.jna.platform.win32.WinBase.FILETIME windowsTime)
    • mapFileGenericAccessToGenericAccess

      public static int mapFileGenericAccessToGenericAccess(int fileAccess)
      TODO
      Parameters:
      fileAccess -
      Returns:
    • convertCreateDispositionToCreationDispostion

      public static int convertCreateDispositionToCreationDispostion(int createDisposition)
      Converts the kernel file creation flags to the win32 flags. Copied from dokan.c
      Parameters:
      createDisposition -
      Returns:
      integer corresponding to an enum in CreationDisposition