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


Java Utils.deleteDir方法代码示例

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


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

示例1: runStep

import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
public void runStep() throws Throwable {
    File homeDir = new File(System.getProperty("user.home"));
    if (homeDir.exists()) {
        File bdaCache = new File(homeDir, ".ivy2-bda-utils");
        if (bdaCache.exists()) {
            LOG.info("Deleting BDA utils ivy cache at " + bdaCache.getAbsolutePath());
            Utils.deleteDir(bdaCache);
        } else {
            LOG.info("BDA utils ivy cache " + bdaCache.getAbsolutePath() + " not found");
        }
        File sdkCache = new File(homeDir, ".ivy2-sdk");
        if (sdkCache.exists()) {
            LOG.info("Deleting sdk ivy cache at " + sdkCache.getAbsolutePath());
            Utils.deleteDir(sdkCache);
        } else {
            LOG.info("SDK ivy cache " + sdkCache.getAbsolutePath() + " not found");
        }
    } else {
        LOG.warn("User home dir " + homeDir.getAbsolutePath() + " not found");
    }
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:22,代码来源:NukeIvyCacheStep.java

示例2: runStep

import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
public void runStep() throws Throwable {
	File oldServiceDir = new File(serviceInfo.getDir());
	if (oldServiceDir.exists()) {
		boolean deleted = Utils.deleteDir(oldServiceDir);
		assertTrue("Failed to delete directory: " + oldServiceDir.getAbsolutePath(), deleted);
	} else {
		System.out.println("Service dir " + oldServiceDir.getAbsolutePath() + " did not exist...");
	}
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:10,代码来源:DeleteOldServiceStep.java

示例3: cleanUp

import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
@AfterClass
public static void cleanUp() {
    LOG.debug("Cleaning up after tests");
    // throw away the temp sdk dir
    LOG.debug("Deleting temp application base dir: " + tempApplicationDir.getAbsolutePath());
    Utils.deleteDir(tempApplicationDir);
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:8,代码来源:SDK42DataServiceSystemTests.java

示例4: runStep

import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
public void runStep() throws Throwable {
	System.out.println("Removing the service skeleton");

	Utils.deleteDir(new File(getBaseDir()
			+ File.separator + tci.getDir()));
	//assertTrue(results);
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:8,代码来源:RemoveSkeletonStep.java

示例5: storyTearDown

import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
@Override
protected void storyTearDown() throws Throwable {
    super.storyTearDown();
    if (TEST_DIR.exists()) {
        Utils.deleteDir(TEST_DIR);
    }
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:8,代码来源:UpgradeMetadataFrom1pt4Story.java

示例6: restoreLatest

import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
public static synchronized void restoreLatest(String currentId, String serviceName, String baseDir)
    throws FileNotFoundException, IOException, Exception {
	File introduceCache = new File(getServiceCachePath());
    String[] cacheFiles = getBackups(serviceName);
    
    long thisTime = Long.parseLong(currentId);
    long lastTime = 0;
    for (int i = 0; i < cacheFiles.length; i++) {
        StringTokenizer strtok = new StringTokenizer(cacheFiles[i], "_", false);
        strtok.nextToken();
        String timeS = strtok.nextToken();
        long time = Long.parseLong(timeS);
        if ((time > lastTime) && (time < thisTime)) {
            lastTime = time;
        }
    }

    File cachedFile = new File(introduceCache.getAbsolutePath(),
        serviceName + "_" + String.valueOf(lastTime) + CACHE_POSTFIX);

    if (cachedFile.exists() && cachedFile.canRead()) {
        // remove the directory
        boolean deleted = Utils.deleteDir(new File(baseDir));
        if (!deleted) {
            logger.warn("Introduce was not able to completely remove the service before restoring the old one.  "
                + "There may be unused new files leftover.");
        }
        
        ZipUtilities.unzip(cachedFile, new File(baseDir));
    } else {
        throw new Exception("Cache file does not exist or is not readable : " + cachedFile.getAbsolutePath());
    }
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:34,代码来源:ResourceManager.java

示例7: storyTearDown

import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
protected void storyTearDown() {
    if (sdkTempDir.exists()) {
        Utils.deleteDir(sdkTempDir);
    }
    if (modelsTempDir.exists()) {
        Utils.deleteDir(modelsTempDir);
    }
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:9,代码来源:FixXmiTestStory.java

示例8: runStep

import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
public void runStep() throws Throwable {
    File zipFile = new File(zipLocation);
    File outDir = new File(unzipLocation);
    assertTrue("Zip file (" + zipFile.getAbsolutePath() + ") not found", 
        zipFile.exists());
    if (outDir.exists()) {
        Utils.deleteDir(outDir);
    }
    ZipUtilities.unzip(zipFile, outDir);
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:11,代码来源:UnzipStep.java

示例9: storyTearDown

import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
public void storyTearDown() throws Throwable {
    Utils.deleteDir(new File(styleTestCaseInfo.getDir()));
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:4,代码来源:SDK4ServiceStyleCreationTest.java

示例10: runStep

import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
public void runStep() throws Throwable {
	LOG.debug("Running step: " + getClass().getName());
	Utils.deleteDir(serviceDir);
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:5,代码来源:DeleteServiceStep.java

示例11: deleteContainer

import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
public void deleteContainer() throws ContainerException {
    if (this.started) {
        throw new ContainerException("Cannot delete running container");
    }
    Utils.deleteDir(this.properties.getContainerDirectory());
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:7,代码来源:ServiceContainer.java

示例12: runStep

import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
public void runStep() throws Throwable {
    assertTrue("Supplied file was not a directory (" + deleteMe.getAbsolutePath() + ")", deleteMe.isDirectory());
    Utils.deleteDir(deleteMe);
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:5,代码来源:DeleteDirectoryStep.java

示例13: runStep

import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
public void runStep() throws Throwable {
    File dir = new File(tempDir);
    Utils.deleteDir(dir);
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:5,代码来源:DeleteModelTempStep.java

示例14: generateSymbolTable

import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
public void generateSymbolTable() throws Exception {

            if ((this.info.getServices() != null) && (this.info.getServices().getService() != null)) {
                for (int serviceI = 0; serviceI < this.info.getServices().getService().length; serviceI++) {

                    ServiceType service = this.info.getServices().getService(serviceI);

                    Emitter parser = new Emitter();
                    SymbolTable table = null;

                    parser.setQuiet(true);
                    // parser.setAllWanted(true);
                    parser.setImports(true);

                    List excludeList = new ArrayList();
                    // one hammer(List), one solution
                    excludeList.addAll(this.excludedSet);
                    parser.setNamespaceExcludes(excludeList);

                    parser.setOutputDir(SyncTools.this.baseDirectory.getAbsolutePath() + File.separator + "tmp");
                    parser.setNStoPkg(SyncTools.this.baseDirectory.getAbsolutePath() + File.separator + "build"
                        + File.separator + IntroduceConstants.NAMESPACE2PACKAGE_MAPPINGS_FILE);
                    // allow configuration of the WSDL2Java parsing timeout.  values < 0 == never timeout
                    String timeoutString = IntroducePropertiesManager.getIntroducePropertyValue(
                        IntroduceConstants.INTRODUCE_WSDL_2_JAVA_TIMEOUT_PRPOERTY);
                    if (timeoutString != null) {
                        try {
                            long timeout = Long.parseLong(timeoutString);
                            parser.setTimeout(timeout);
                            logger.debug("Set WSDL 2 Java parser timeout to " + timeout + " ms");
                        } catch (Exception ex) {
                            logger.warn("Error reading introduce property " 
                                + IntroduceConstants.INTRODUCE_WSDL_2_JAVA_TIMEOUT_PRPOERTY 
                                + " with value " + timeoutString);
                        }
                    }
                    try {
                        parser.run(new File(SyncTools.this.baseDirectory.getAbsolutePath()
                            + File.separator
                            + "build"
                            + File.separator
                            + "schema"
                            + File.separator
                            + this.info.getIntroduceServiceProperties().get(
                                IntroduceConstants.INTRODUCE_SKELETON_SERVICE_NAME) + File.separator
                            + service.getName() + ".wsdl").getAbsolutePath());
                    } catch (Exception e) {
                        logger.error(e.getMessage(), e);
                    }
                    table = parser.getSymbolTable();

                    this.symbolTables.add(table);
                    parser = null;
                    System.gc();
                }

            }

            Utils.deleteDir(new File(SyncTools.this.baseDirectory.getAbsolutePath() + File.separator + "tmp"));
        }
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:61,代码来源:SyncTools.java

示例15: mapFromSdkGeneratedSchemas

import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
public void mapFromSdkGeneratedSchemas() throws Exception {
    // locate the directory we'll copy schemas in to
    File schemaDir = getServiceSchemaDirectory();
    
    // get cadsr information
    // the config jar will have the xsds in it
    File configJarFile = SharedConfiguration.getInstance().getRemoteConfigJarFile();
    JarFile configJar = new JarFile(configJarFile);
    
    // copy all the XSDs into a temporary location.  Must do this so 
    // schemas which reference eachother can be resolved
    File tempXsdDir = File.createTempFile("TempCaCoreXSDs", "dir");
    tempXsdDir.delete();
    tempXsdDir.mkdirs();
    Enumeration<JarEntry> entries = configJar.entries();
    while (entries.hasMoreElements()) {
        JarEntry entry = entries.nextElement();
        if (entry.getName().endsWith(".xsd")) {
            StringBuffer schemaText = JarUtilities.getFileContents(configJar, entry.getName());
            File schemaFile = new File(tempXsdDir, new File(entry.getName()).getName());
            Utils.stringBufferToFile(schemaText, schemaFile.getAbsolutePath());
        }
    }
    configJar.close();
    
    // iterate the schemas and try to map them to domain packages
    for (File xsdFile : tempXsdDir.listFiles()) {
        String schemaPackageName = xsdFile.getName();
        schemaPackageName = schemaPackageName.substring(0, schemaPackageName.length() - 4);
        // find the package of this name
        for (String packageName : dataManager.getCadsrPackageNames()) {
            if (packageName.equals(schemaPackageName)) {
                // create the namespace type of the XSD
                NamespaceType nsType = CommonTools.createNamespaceType(xsdFile.getAbsolutePath(), schemaDir);
                
                // add the namespace to the service definition
                CommonTools.addNamespace(getServiceInformation().getServiceDescriptor(), nsType);
                
                // copy the XSD in to the service's schema dir
                File xsdOut = new File(schemaDir, xsdFile.getName());
                Utils.copyFile(xsdFile, xsdOut);
                nsType.setLocation(xsdOut.getName());
                
                // get cadsr package, set namespace, automagic mapping
                modelInfoUtil.setMappedNamespace(packageName, nsType.getNamespace());
                automaticalyMapElementsToClasses(packageName, nsType);
                break;
            }
        }
    }
    
    // throw out the temp XSD directory
    Utils.deleteDir(tempXsdDir);
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:55,代码来源:SchemaMappingConfigStep.java


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