Interface File

All Superinterfaces:
Browsable, DirectoryEntry, Extensible, Identifiable, OsidObject

public interface File extends DirectoryEntry

File represents a file in a file system.

  • Method Details

    • hasSize

      boolean hasSize()
      Tests if this file has a known size.
      Returns:
      true if this file has a size, false otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getSize

      long getSize()
      Gets the size of this file in bytes if hasSize() is true .
      Returns:
      the size of this file
      Throws:
      IllegalStateException - hasSize() is false
      Compliance:
      mandatory - This method must be implemented.
    • getFileRecord

      FileRecord getFileRecord(Type fileRecordType) throws OperationFailedException
      Gets the file record corresponding to the given File record Type .This method is used to retrieve an object implementing the requested record. The fileRecordType may be the Type returned in getRecordTypes() or any of its parents in a Type hierarchy where hasRecordType(fileRecordType) is true .
      Parameters:
      fileRecordType - the file record type
      Returns:
      the file record
      Throws:
      NullArgumentException - fileRecordType is null
      OperationFailedException - unable to complete request
      UnsupportedException - hasRecordType(fileRecordType) is false
      Compliance:
      mandatory - This method must be implemented.