mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-06-30 18:15:39 +00:00
ContentDiskDriver rework. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@29451 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
69 lines
1.6 KiB
Java
69 lines
1.6 KiB
Java
package org.alfresco.filesys.repo;
|
|
|
|
import java.io.File;
|
|
import java.io.Reader;
|
|
|
|
import org.alfresco.jlan.server.filesys.cache.FileState;
|
|
import org.alfresco.jlan.server.filesys.cache.NetworkFileStateInterface;
|
|
import org.alfresco.jlan.smb.server.disk.JavaNetworkFile;
|
|
|
|
/**
|
|
* Temporary Java backed network file.
|
|
*
|
|
* @author mrogers
|
|
*/
|
|
public class TempNetworkFile extends JavaNetworkFile implements NetworkFileStateInterface
|
|
{
|
|
/**
|
|
* Create a new temporary file with no existing content.
|
|
*
|
|
* @param file the underlying File
|
|
* @param netPath where in the repo this file is going.
|
|
*/
|
|
public TempNetworkFile(File file, String netPath)
|
|
{
|
|
super(file, netPath);
|
|
setFullName(netPath);
|
|
}
|
|
|
|
/**
|
|
* A new temporary network file with some existing content.
|
|
* @param file
|
|
* @param netPath
|
|
* @param existingContent
|
|
*/
|
|
public TempNetworkFile(File file, String netPath, Reader existingContent)
|
|
{
|
|
super(file, netPath);
|
|
setFullName(netPath);
|
|
}
|
|
|
|
/**
|
|
* Access to the underlying file.
|
|
* @return the file.
|
|
*/
|
|
public File getFile()
|
|
{
|
|
return m_file;
|
|
}
|
|
|
|
public String toString()
|
|
{
|
|
return "TempNetworkFile:" + getFullName() + " path: " + m_file.getAbsolutePath();
|
|
}
|
|
|
|
// For JLAN file state lock manager
|
|
public void setFileState(FileState fileState)
|
|
{
|
|
this.fileState = fileState;
|
|
}
|
|
|
|
@Override
|
|
public FileState getFileState()
|
|
{
|
|
return fileState;
|
|
|
|
}
|
|
private FileState fileState;
|
|
}
|