本文整理汇总了Java中org.alfresco.jlan.server.filesys.FileInfo.setModifyDateTime方法的典型用法代码示例。如果您正苦于以下问题:Java FileInfo.setModifyDateTime方法的具体用法?Java FileInfo.setModifyDateTime怎么用?Java FileInfo.setModifyDateTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.alfresco.jlan.server.filesys.FileInfo
的用法示例。
在下文中一共展示了FileInfo.setModifyDateTime方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFileInfo
import org.alfresco.jlan.server.filesys.FileInfo; //导入方法依赖的package包/类
@Override
public FileInfo getFileInfo() {
final FileInfo existingFileInfo = getInfo();
if (existingFileInfo != null) {
return existingFileInfo;
}
final IScsiLogicalUnitCapacity capacity = _removeDeviceInfo.getCapacity();
final long blockCount = capacity.getLogicalBlockAddress() + 1;
final long sizeInBytes = (blockCount * capacity.getBlockSize());
final FileInfo newFileInfo = new PseudoFileInfo(getFileName(), sizeInBytes, getAttributes());
newFileInfo.setCreationDateTime(_creationDateTime);
newFileInfo.setModifyDateTime(_creationDateTime);
newFileInfo.setChangeDateTime(_creationDateTime);
newFileInfo.setAllocationSize(blockCount * capacity.getBlockSize());
setFileInfo(newFileInfo);
return newFileInfo;
}
示例2: nextFileInfo
import org.alfresco.jlan.server.filesys.FileInfo; //导入方法依赖的package包/类
/**
* Return file information for the next file in the active search. Returns false if the search
* is complete.
*
* @param info FileInfo to return the file information.
* @return true if the file information is valid, else false
*/
public boolean nextFileInfo(FileInfo info)
{
// Get the file information for the next file
if ( super.nextFileInfo( info) == false)
return false;
else if ( returningPseudoFiles() == true || m_stateCache == null)
return true;
// We have a real file entry, check if there is a cache entry
StringBuilder relPath = new StringBuilder( getRelativePath());
relPath.append( info.getFileName());
FileState fstate = m_stateCache.findFileState( relPath.toString());
if ( fstate != null)
{
// Check if there are current timestamps that can be used to override the database values
if ( fstate.hasAccessDateTime())
info.setAccessDateTime( fstate.getAccessDateTime());
if ( fstate.hasModifyDateTime())
info.setModifyDateTime( fstate.getModifyDateTime());
// File used/allocation size
if ( fstate.hasFileSize())
info.setFileSize( fstate.getFileSize());
if ( fstate.hasAllocationSize() && fstate.getAllocationSize() > info.getSize())
info.setAllocationSize( fstate.getAllocationSize());
// DEBUG
if ( logger.isDebugEnabled())
logger.debug("Search timestamps from cache, path=" + info.getFileName());
}
// Indicate that the file information is valid
return true;
}
示例3: correct
import org.alfresco.jlan.server.filesys.FileInfo; //导入方法依赖的package包/类
public void correct(FileInfo info, String folderPath)
{
ContentContext tctx = (ContentContext) tree.getContext();
String path = folderPath + info.getFileName();
if(tctx.hasStateCache())
{
FileStateCache cache = tctx.getStateCache();
FileState fstate = cache.findFileState( path, true);
if(fstate != null)
{
logger.debug("correct " + path);
/*
* What about stale file state values here?
*/
if(fstate.hasFileSize())
{
if(logger.isDebugEnabled())
{
logger.debug("replace file size " + info.getSize() + " with " + fstate.getFileSize());
}
info.setFileSize(fstate.getFileSize());
}
if ( fstate.hasAccessDateTime())
{
if(logger.isDebugEnabled())
{
logger.debug("replace access date " + new Date(info.getAccessDateTime()) + " with " + new Date(fstate.getAccessDateTime()));
}
info.setAccessDateTime(fstate.getAccessDateTime());
}
if ( fstate.hasChangeDateTime())
{
if(logger.isDebugEnabled())
{
logger.debug("replace change date " + new Date(info.getChangeDateTime()) + " with " + new Date(fstate.getChangeDateTime()));
}
info.setChangeDateTime(fstate.getChangeDateTime());
}
if ( fstate.hasModifyDateTime())
{
if(logger.isDebugEnabled())
{
logger.debug("replace modified date " + new Date(info.getModifyDateTime()) + " with " + new Date(fstate.getModifyDateTime()));
}
info.setModifyDateTime(fstate.getModifyDateTime());
}
if ( fstate.hasAllocationSize())
{
if(logger.isDebugEnabled())
{
logger.debug("replace allocation size" + info.getAllocationSize() + " with " + fstate.getAllocationSize());
}
info.setAllocationSize(fstate.getAllocationSize());
}
}
}
}