当前位置: 首页>>代码示例>>Java>>正文


Java FileInfo.setChangeDateTime方法代码示例

本文整理汇总了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;
}
 
开发者ID:raqet,项目名称:acquisition-server,代码行数:23,代码来源:RemotePseudoFile.java

示例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());
            }
        }           
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:61,代码来源:InFlightCorrectorImpl.java


注:本文中的org.alfresco.jlan.server.filesys.FileInfo.setChangeDateTime方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。