本文整理汇总了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();
}
}
示例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 );
}
示例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();
}
示例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();
}
}
示例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();
}
示例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();
}
示例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();
}
示例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);
}
示例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();
}
示例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();
}
示例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();
}
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}