Class TempNetworkFile

java.lang.Object
org.alfresco.jlan.server.filesys.NetworkFile
org.alfresco.jlan.smb.server.disk.JavaNetworkFile
org.alfresco.filesys.repo.TempNetworkFile
All Implemented Interfaces:
NetworkFileLegacyReferenceCount, org.alfresco.jlan.server.filesys.cache.NetworkFileStateInterface

public class TempNetworkFile extends org.alfresco.jlan.smb.server.disk.JavaNetworkFile implements org.alfresco.jlan.server.filesys.cache.NetworkFileStateInterface, NetworkFileLegacyReferenceCount
Temporary Java backed network file.
Author:
mrogers
  • Field Summary

    Fields inherited from class org.alfresco.jlan.smb.server.disk.JavaNetworkFile

    m_eof, m_file, m_io

    Fields inherited from class org.alfresco.jlan.server.filesys.NetworkFile

    ATTRIBUTESONLY, Created, DelayedClose, DelayedWriteError, DeleteOnClose, IOPending, m_accessDate, m_allowedAccess, m_attrib, m_closed, m_createDate, m_dirId, m_fid, m_fileSize, m_fullName, m_grantedAccess, m_modifyDate, m_name, m_streamId, m_streamName, m_uniqueId, m_writeCount, READONLY, READWRITE, WRITEONLY
  • Constructor Summary

    Constructors
    Constructor
    Description
    TempNetworkFile(File file, String netPath)
    Create a new temporary file with no existing content.
    TempNetworkFile(File file, String netPath, Reader existingContent)
    A new temporary network file with some existing content.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Tell JLAN it needs to call disk.closeFile rather than short cutting.
    final int
    Decrement the legacy file open count
    Access to the underlying file.
    org.alfresco.jlan.server.filesys.cache.FileState
     
    final int
    Return the legacy open file count
    final int
    Increment the legacy file open count
    boolean
     
    boolean
     
    int
    readFile(byte[] buf, int len, int pos, long fileOff)
     
    void
    setChanged(boolean changed)
     
    void
    setFileState(org.alfresco.jlan.server.filesys.cache.FileState fileState)
     
    void
    setModificationDateSetDirectly(boolean modificationDateSetDirectly)
     
     
    void
    truncateFile(long size)
     
    void
    writeFile(byte[] buf, int len, int pos)
     
    void
    writeFile(byte[] buffer, int length, int position, long fileOffset)
     

    Methods inherited from class org.alfresco.jlan.smb.server.disk.JavaNetworkFile

    closeFile, currentPosition, flushFile, isEndOfFile, openFile, seekFile

    Methods inherited from class org.alfresco.jlan.server.filesys.NetworkFile

    addLock, close, getAccessDate, getAccessToken, getAllowedAccess, getCreationDate, getDirectoryId, getFileAttributes, getFileId, getFileSize, getFileSizeInt, getFullName, getFullNameStream, getGrantedAccess, getGrantedAccessAsString, getLockAt, getLockList, getModifyDate, getName, getOpLock, getProtocolId, getStreamId, getStreamName, getUniqueId, getWriteCount, hasAccessDate, hasAccessToken, hasCreationDate, hasDelayedClose, hasDelayedWriteError, hasDeleteOnClose, hasIOPending, hasLocks, hasModifyDate, hasNTAttribute, hasOpLock, incrementWriteCount, isArchived, isClosed, isDirectory, isForce, isHidden, isReadOnly, isStream, isSystem, numberOfLocks, removeAllLocks, removeLock, setAccessDate, setAccessToken, setAllowedAccess, setAttributes, setClosed, setCreationDate, setDelayedClose, setDelayedWriteError, setDeleteOnClose, setDirectoryId, setFileId, setFileSize, setFileSize, setForce, setFullName, setGrantedAccess, setIOPending, setModifyDate, setName, setOpLock, setProtocolId, setStatusFlag, setStreamId, setStreamName, setUniqueId, setUniqueId, setUniqueId, wasCreated

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • TempNetworkFile

      public TempNetworkFile(File file, String netPath)
      Create a new temporary file with no existing content.
      Parameters:
      file - the underlying File
      netPath - where in the repo this file is going.
    • TempNetworkFile

      public TempNetworkFile(File file, String netPath, Reader existingContent)
      A new temporary network file with some existing content.
      Parameters:
      file - File
      netPath - String
      existingContent - Reader
  • Method Details

    • getFile

      public File getFile()
      Access to the underlying file.
      Returns:
      the file.
    • toString

      public String toString()
      Overrides:
      toString in class org.alfresco.jlan.server.filesys.NetworkFile
    • readFile

      public int readFile(byte[] buf, int len, int pos, long fileOff) throws IOException
      Overrides:
      readFile in class org.alfresco.jlan.smb.server.disk.JavaNetworkFile
      Throws:
      IOException
    • writeFile

      public void writeFile(byte[] buf, int len, int pos) throws IOException
      Overrides:
      writeFile in class org.alfresco.jlan.smb.server.disk.JavaNetworkFile
      Throws:
      IOException
    • writeFile

      public void writeFile(byte[] buffer, int length, int position, long fileOffset) throws IOException
      Overrides:
      writeFile in class org.alfresco.jlan.smb.server.disk.JavaNetworkFile
      Throws:
      IOException
    • truncateFile

      public void truncateFile(long size) throws IOException
      Overrides:
      truncateFile in class org.alfresco.jlan.smb.server.disk.JavaNetworkFile
      Throws:
      IOException
    • setFileState

      public void setFileState(org.alfresco.jlan.server.filesys.cache.FileState fileState)
    • getFileState

      public org.alfresco.jlan.server.filesys.cache.FileState getFileState()
      Specified by:
      getFileState in interface org.alfresco.jlan.server.filesys.cache.NetworkFileStateInterface
    • allowsOpenCloseViaNetworkFile

      public boolean allowsOpenCloseViaNetworkFile()
      Tell JLAN it needs to call disk.closeFile rather than short cutting.
      Overrides:
      allowsOpenCloseViaNetworkFile in class org.alfresco.jlan.server.filesys.NetworkFile
      Returns:
      boolean
    • setChanged

      public void setChanged(boolean changed)
    • isChanged

      public boolean isChanged()
    • isModificationDateSetDirectly

      public boolean isModificationDateSetDirectly()
    • setModificationDateSetDirectly

      public void setModificationDateSetDirectly(boolean modificationDateSetDirectly)
    • incrementLegacyOpenCount

      public final int incrementLegacyOpenCount()
      Increment the legacy file open count
      Specified by:
      incrementLegacyOpenCount in interface NetworkFileLegacyReferenceCount
      Returns:
      int
    • decrementLagacyOpenCount

      public final int decrementLagacyOpenCount()
      Decrement the legacy file open count
      Specified by:
      decrementLagacyOpenCount in interface NetworkFileLegacyReferenceCount
      Returns:
      int
    • getLegacyOpenCount

      public final int getLegacyOpenCount()
      Return the legacy open file count
      Specified by:
      getLegacyOpenCount in interface NetworkFileLegacyReferenceCount
      Returns:
      int