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


Java FileInfo.setAllocationSize方法代码示例

本文整理汇总了Java中org.alfresco.jlan.server.filesys.FileInfo.setAllocationSize方法的典型用法代码示例。如果您正苦于以下问题:Java FileInfo.setAllocationSize方法的具体用法?Java FileInfo.setAllocationSize怎么用?Java FileInfo.setAllocationSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.alfresco.jlan.server.filesys.FileInfo的用法示例。


在下文中一共展示了FileInfo.setAllocationSize方法的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;
}
 
开发者ID:raqet,项目名称:acquisition-server,代码行数:23,代码来源:RemotePseudoFile.java

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

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


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