Class 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​(java.io.File file, java.lang.String netPath)
      Create a new temporary file with no existing content.
      TempNetworkFile​(java.io.File file, java.lang.String netPath, java.io.Reader existingContent)
      A new temporary network file with some existing content.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean allowsOpenCloseViaNetworkFile()
      Tell JLAN it needs to call disk.closeFile rather than short cutting.
      int decrementLagacyOpenCount()
      Decrement the legacy file open count
      java.io.File getFile()
      Access to the underlying file.
      org.alfresco.jlan.server.filesys.cache.FileState getFileState()  
      int getLegacyOpenCount()
      Return the legacy open file count
      int incrementLegacyOpenCount()
      Increment the legacy file open count
      boolean isChanged()  
      boolean isModificationDateSetDirectly()  
      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)  
      java.lang.String toString()  
      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 Detail

      • TempNetworkFile

        public TempNetworkFile​(java.io.File file,
                               java.lang.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​(java.io.File file,
                               java.lang.String netPath,
                               java.io.Reader existingContent)
        A new temporary network file with some existing content.
        Parameters:
        file - File
        netPath - String
        existingContent - Reader
    • Method Detail

      • getFile

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

        public java.lang.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 java.io.IOException
        Overrides:
        readFile in class org.alfresco.jlan.smb.server.disk.JavaNetworkFile
        Throws:
        java.io.IOException
      • writeFile

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

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

        public void truncateFile​(long size)
                          throws java.io.IOException
        Overrides:
        truncateFile in class org.alfresco.jlan.smb.server.disk.JavaNetworkFile
        Throws:
        java.io.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)