當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。