本文整理汇总了Java中org.alfresco.jlan.server.filesys.FileInfo.setChangeDateTime方法的典型用法代码示例。如果您正苦于以下问题:Java FileInfo.setChangeDateTime方法的具体用法?Java FileInfo.setChangeDateTime怎么用?Java FileInfo.setChangeDateTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.alfresco.jlan.server.filesys.FileInfo
的用法示例。
在下文中一共展示了FileInfo.setChangeDateTime方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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());
}
}
}
}