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


Java Delete.setDir方法代码示例

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


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

示例1: unZip

import org.apache.tools.ant.taskdefs.Delete; //导入方法依赖的package包/类
public static void unZip(String zipPath,String targetFolder,boolean cleanZip){
	File folderFile =new File(targetFolder);
	File zipFile = new File(zipPath);
	Project prj = new Project();
	Expand expand = new Expand();
	expand.setEncoding("UTF-8");
	expand.setProject(prj);
	expand.setSrc(zipFile);
	expand.setOverwrite(true);
	expand.setDest(folderFile);
	expand.execute();
	
	if(cleanZip){
		//清除zip包
		Delete delete = new Delete();
		delete.setProject(prj);
		delete.setDir(zipFile);
		delete.execute();
	}
}
 
开发者ID:yulele166,项目名称:pub-service,代码行数:21,代码来源:FileUtil.java

示例2: execute

import org.apache.tools.ant.taskdefs.Delete; //导入方法依赖的package包/类
public void execute() throws Exception {
    Delete t = new Delete();
    t.setDir( project.getAntOutputDir() );
    antTaskRunner.runTask( t );

    File header = project.getDeployHeaderFile();
    boolean del = header.delete();
    System.out.println( "Delete header file=" + del );

    File[] files = project.getDeployDir().listFiles( new FileFilter() {
        public boolean accept( File pathname ) {
            return !pathname.isDirectory();
        }
    } );
    for ( int i = 0; i < files.length; i++ ) {
        File file = files[i];
        boolean deleted = file.delete();
        System.out.println( "Delete " + file + " = " + deleted );
    }

    Delete d = new Delete();
    d.setDir( project.getContribLicenseDir() );
    antTaskRunner.runTask( d );
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:25,代码来源:PhetCleanCommand.java

示例3: recursivelyDeleteDir

import org.apache.tools.ant.taskdefs.Delete; //导入方法依赖的package包/类
/**
 * Delete a directory and all subdirectories
 */
public static void recursivelyDeleteDir(File customProfileDir) {
	if (customProfileDir == null || !customProfileDir.exists()) {
		return;
	}
	Delete delete = new Delete();
	delete.setProject(new Project());
	delete.setDir(customProfileDir);
	delete.setFailOnError(true);
	delete.execute();
}
 
开发者ID:epam,项目名称:Wilma,代码行数:14,代码来源:LauncherUtils.java

示例4: testWithoutPreviousResolveAndNonDefaultCache

import org.apache.tools.ant.taskdefs.Delete; //导入方法依赖的package包/类
@Test
public void testWithoutPreviousResolveAndNonDefaultCache() {
    File cache2 = new File("build/cache2");
    cache2.mkdirs();

    try {
        project.setProperty("ivy.dep.file", "test/java/org/apache/ivy/ant/ivy-simple.xml");
        fileset.setSetid("simple-setid");
        System.setProperty("ivy.cache.dir", cache2.getAbsolutePath());
        fileset.execute();
        Object ref = project.getReference("simple-setid");
        assertNotNull(ref);
        assertTrue(ref instanceof FileSet);
        FileSet fs = (FileSet) ref;
        DirectoryScanner directoryScanner = fs.getDirectoryScanner(project);
        assertEquals(1, directoryScanner.getIncludedFiles().length);
        assertEquals(
            getArchiveFileInCache("org1", "mod1.2", "2.0", "mod1.2", "jar", "jar", cache2)
                    .getAbsolutePath(), new File(directoryScanner.getBasedir(),
                    directoryScanner.getIncludedFiles()[0]).getAbsolutePath());
    } finally {
        Delete del = new Delete();
        del.setProject(new Project());
        del.setDir(cache2);
        del.execute();
    }
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:28,代码来源:IvyCacheFilesetTest.java

示例5: tearDown

import org.apache.tools.ant.taskdefs.Delete; //导入方法依赖的package包/类
@After
public void tearDown() {
    TestHelper.cleanCache();
    Delete del = new Delete();
    del.setProject(new Project());
    del.setDir(new File("build/test/retrieve"));
    del.execute();
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:9,代码来源:RetrieveTest.java

示例6: tearDown

import org.apache.tools.ant.taskdefs.Delete; //导入方法依赖的package包/类
@After
public void tearDown() {
    IvyContext.popContext();
    Delete del = new Delete();
    del.setProject(new Project());
    del.setDir(cacheManager.getRepositoryCacheRoot());
    del.execute();
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:9,代码来源:DefaultRepositoryCacheManagerTest.java

示例7: clean

import org.apache.tools.ant.taskdefs.Delete; //导入方法依赖的package包/类
private void clean(File tempDirectory) {
	Delete cleanupTask = new Delete();
	cleanupTask.setProject(getProject());
	cleanupTask.setTaskName(getTaskName());
	cleanupTask.setLocation(getLocation());
	cleanupTask.setDir(tempDirectory);
	cleanupTask.perform();
}
 
开发者ID:rednoah,项目名称:ant-spk,代码行数:9,代码来源:PackageTask.java

示例8: maybeClearLocalRepo

import org.apache.tools.ant.taskdefs.Delete; //导入方法依赖的package包/类
/**
 * If setup with a local repo, clean it
 */
private void maybeClearLocalRepo() {
    File basedir = getLocalRepoBaseDir();
    if (basedir == null) {
        return;
    }

    log("Deleting the local repository '" + basedir + "'", Project.MSG_VERBOSE);

    Delete delete = new Delete();
    delete.setFailOnError(false);
    delete.setDir(basedir);
}
 
开发者ID:apache,项目名称:ant-easyant-core,代码行数:16,代码来源:ImportAntscripts.java

示例9: deleteDir

import org.apache.tools.ant.taskdefs.Delete; //导入方法依赖的package包/类
private static void deleteDir(Project project, File dir) {
	Delete deleteTask = new Delete();
	deleteTask.setProject(project);
	deleteTask.setTaskName("delete dir");
	deleteTask.setDir(dir);
	deleteTask.execute();
}
 
开发者ID:th-schwarz,项目名称:pmcms,代码行数:8,代码来源:InternalAntTool.java

示例10: cleanupTestDir

import org.apache.tools.ant.taskdefs.Delete; //导入方法依赖的package包/类
@After
public void cleanupTestDir() {
        Delete delete = new Delete();
        delete.setProject(new Project());
        delete.setDir(testDir);
        delete.setQuiet(true);
        delete.setIncludeEmptyDirs(true);
        delete.execute();
}
 
开发者ID:rimerosolutions,项目名称:ant-wrapper,代码行数:10,代码来源:InstallerTest.java

示例11: deleteFolder

import org.apache.tools.ant.taskdefs.Delete; //导入方法依赖的package包/类
public static void deleteFolder(File folder) {
        if (folder.exists()) {
                Delete delete = new Delete();
                delete.setProject(new Project());
                delete.setDir(folder);
                delete.setIncludeEmptyDirs(true);
                delete.setQuiet(true);
                delete.execute();
        }
}
 
开发者ID:rimerosolutions,项目名称:ant-wrapper,代码行数:11,代码来源:IOUtils.java

示例12: cleanTestDir

import org.apache.tools.ant.taskdefs.Delete; //导入方法依赖的package包/类
private void cleanTestDir() {
    Delete del = new Delete();
    del.setProject(new Project());
    del.setDir(new File("build/test/deliver"));
    del.execute();
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:7,代码来源:IvyDeliverTest.java

示例13: cleanRetrieveDir

import org.apache.tools.ant.taskdefs.Delete; //导入方法依赖的package包/类
private void cleanRetrieveDir() {
    Delete del = new Delete();
    del.setProject(new Project());
    del.setDir(new File("build/test/retrieve"));
    del.execute();
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:7,代码来源:IvyDeliverTest.java

示例14: cleanRep

import org.apache.tools.ant.taskdefs.Delete; //导入方法依赖的package包/类
private void cleanRep() {
    Delete del = new Delete();
    del.setProject(new Project());
    del.setDir(new File("test/repositories/1/apache"));
    del.execute();
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:7,代码来源:IvyDeliverTest.java

示例15: cleanCache

import org.apache.tools.ant.taskdefs.Delete; //导入方法依赖的package包/类
public static void cleanCache() {
    Delete del = new Delete();
    del.setProject(new Project());
    del.setDir(cache);
    del.execute();
}
 
开发者ID:apache,项目名称:ant-ivy,代码行数:7,代码来源:TestHelper.java


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