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


Java TFile.exists方法代码示例

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


在下文中一共展示了TFile.exists方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkCompatibleVersion

import de.schlichtherle.truezip.file.TFile; //导入方法依赖的package包/类
@Override
public void checkCompatibleVersion(TFile war, ModuleDetails installingModuleDetails)
{
    //Version check
    TFile propsFile = new TFile(war+VERSION_PROPERTIES);
    if (propsFile != null && propsFile.exists())
    {
        log.info("INFO: Checking the war version using "+VERSION_PROPERTIES);
        Properties warVers = loadProperties(propsFile);
        VersionNumber warVersion = new VersionNumber(warVers.getProperty("version.major")+"."+warVers.getProperty("version.minor")+"."+warVers.getProperty("version.revision"));
        checkVersions(warVersion, installingModuleDetails);
    }
    else 
    {
        log.info("INFO: Checking the war version using the manifest.");
    	checkCompatibleVersionUsingManifest(war,installingModuleDetails);
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:19,代码来源:WarHelperImpl.java

示例2: checkCompatibleEdition

import de.schlichtherle.truezip.file.TFile; //导入方法依赖的package包/类
@Override
public void checkCompatibleEdition(TFile war, ModuleDetails installingModuleDetails)
{

    List<String> installableEditions = installingModuleDetails.getEditions();

    if (installableEditions != null && installableEditions.size() > 0) {
        
        TFile propsFile = new TFile(war+VERSION_PROPERTIES);
        if (propsFile != null && propsFile.exists())
        {
            Properties warVers = loadProperties(propsFile);
            String warEdition = warVers.getProperty("version.edition");
            
            for (String edition : installableEditions)
            {
                if (warEdition.equalsIgnoreCase(edition))
                {
                    return;  //successful match.
                }
            }
            throw new ModuleManagementToolException("The module ("+installingModuleDetails.getTitle()
                        +") can only be installed in one of the following editions"+installableEditions);
        } else {
        	checkCompatibleEditionUsingManifest(war,installingModuleDetails);
        }
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:29,代码来源:WarHelperImpl.java

示例3: isShareWar

import de.schlichtherle.truezip.file.TFile; //导入方法依赖的package包/类
@Override
public boolean isShareWar(TFile warFile)
{
    if (!warFile.exists())
    {
        throw new ModuleManagementToolException("The war file '" + warFile + "' does not exist.");     
    }
    
    String title = findManifestArtibute(warFile, MANIFEST_SPECIFICATION_TITLE);
    if (MANIFEST_SHARE.equals(title)) return true;  //It is share
    
    return false; //default
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:14,代码来源:WarHelperImpl.java

示例4: saveModuleDetails

import de.schlichtherle.truezip.file.TFile; //导入方法依赖的package包/类
/**
 * Saves the module details to the war in the correct location based on the module id
 * 
 * @param warLocation   the war location
 * @param moduleDetails      the module id
 */
public static void saveModuleDetails(String warLocation, ModuleDetails moduleDetails)
{
    // Ensure that it is a valid set of properties
    String moduleId = moduleDetails.getId();
    try
    {
        String modulePropertiesFileLocation = getModulePropertiesFileLocation(warLocation, moduleId);
        TFile file = new TFile(modulePropertiesFileLocation);
        if (file.exists() == false)
        {
            file.createNewFile();
        }  
        
        // Get all the module properties
        Properties moduleProperties = moduleDetails.getProperties();
        OutputStream os = new TFileOutputStream(file);
        try
        {
            moduleProperties.store(os, null);
        }
        finally
        {
            os.close();
        }
    }
    catch (IOException exception)
    {
        throw new ModuleManagementToolException(
                "Unable to save module details into WAR file: \n" +
                "   Module: " + moduleDetails.getId() + "\n" +
                "   Properties: " + moduleDetails.getProperties(),
                exception);
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:41,代码来源:ModuleDetailsHelper.java

示例5: copyFileIfNotNull

import de.schlichtherle.truezip.file.TFile; //导入方法依赖的package包/类
private void copyFileIfNotNull(File file, TFile destination) throws IOException {
	if (file != null) {
		TFile src = TFileRegistry.create(file);
		String fileName = file.getName();
		
		TFile doublon = TFileRegistry.create(destination, fileName);
		if (doublon.exists()) {
			if (!doublons.containsKey(destination)) {
				doublons.put(destination, new HashMap<String, Long>());
			}
			
			if (doublons.get(destination).containsKey(fileName)) {
				doublons.get(destination).put(fileName, doublons.get(destination).get(fileName)+1L);
			} else {
				doublons.get(destination).put(fileName, 1L);
			}
			
			fileName = fileName + "(" + doublons.get(destination).get(fileName) + ")";
		}
		
		TFile dst = TFileRegistry.create(destination);
		if (dst.isArchive() || dst.isDirectory()) {
			dst = TFileRegistry.create(dst, fileName);
		}
		
		src.cp_rp(dst);
	}
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:29,代码来源:FileDownloadPanel.java


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