java.lang.Object
org.cryptomator.frontend.dokany.adapter.OpenHandle
org.cryptomator.frontend.dokany.adapter.OpenFile
All Implemented Interfaces:
Closeable, AutoCloseable
Direct Known Subclasses:
OpenRestrictedFile

public class OpenFile extends OpenHandle
  • Constructor Details

  • Method Details

    • read

      public int read(com.sun.jna.Pointer buf, int num, long offset) throws IOException
      Reads up to num bytes beginning at offset into buf
      Parameters:
      buf - Buffer
      num - Number of bytes to read
      offset - Position of first byte to read
      Returns:
      Actual number of bytes read (can be less than num if reached EOF).
      Throws:
      IOException - If an exception occurs during read.
    • write

      public int write(com.sun.jna.Pointer buf, int num, long offset) throws IOException
      Writes up to num bytes from buf into the current file beginning at offset
      Parameters:
      buf - Buffer
      num - Number of bytes to write
      offset - Position of first byte to write at
      Returns:
      Actual number of bytes written TODO: only the bytes which contains information or also some filling zeros?
      Throws:
      IOException - If an exception occurs during write.
    • append

      public int append(com.sun.jna.Pointer buf, int num) throws IOException
      Throws:
      IOException
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in class OpenHandle
      Throws:
      IOException
    • flush

      public void flush() throws IOException
      Throws:
      IOException
    • truncate

      public void truncate(long size) throws IOException
      Throws:
      IOException
    • canBeDeleted

      public boolean canBeDeleted()
      Test if we can delete this file.
      Returns:
      true if no concurrent routine holds a lock on this file or the file is opened as read-only
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • open

      public static OpenFile open(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) throws IOException
      Throws:
      IOException