本文整理了Java中org.eclipse.equinox.internal.p2.core.helpers.FileUtils.deleteAll()
方法的一些代码示例,展示了FileUtils.deleteAll()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileUtils.deleteAll()
方法的具体详情如下:
包路径:org.eclipse.equinox.internal.p2.core.helpers.FileUtils
类名称:FileUtils
方法名:deleteAll
暂无
代码示例来源:origin: com.github.veithen.cosmos.bootstrap/org.eclipse.equinox.p2.artifact.repository
private void cleanupWorkDir() {
if (workDir != null) {
FileUtils.deleteAll(workDir);
// TODO try twice since there seems to be some cases where the dir is not
// deleted the first time. At least on Windows...
FileUtils.deleteAll(workDir);
}
}
代码示例来源:origin: org.eclipse.equinox.p2.artifact/repository
private void cleanupWorkDir() throws IOException {
if (workDir != null) {
FileUtils.deleteAll(workDir);
// TODO try twice since there seems to be some cases where the dir is not
// deleted the first time. At least on Windows...
FileUtils.deleteAll(workDir);
}
}
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.equinox.p2.artifact.repository
private void cleanupWorkDir() {
if (workDir != null) {
FileUtils.deleteAll(workDir);
// TODO try twice since there seems to be some cases where the dir is not
// deleted the first time. At least on Windows...
FileUtils.deleteAll(workDir);
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.equinox.p2.artifact.repository
private void cleanupWorkDir() {
if (workDir != null) {
FileUtils.deleteAll(workDir);
// TODO try twice since there seems to be some cases where the dir is not
// deleted the first time. At least on Windows...
FileUtils.deleteAll(workDir);
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.equinox.p2.core
public static void deleteAll(File file) {
if (!file.exists())
return;
if (file.isDirectory()) {
File[] files = file.listFiles();
if (files != null)
for (int i = 0; i < files.length; i++)
deleteAll(files[i]);
}
file.delete();
}
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.equinox.p2.core
public static void deleteAll(File file) {
if (!file.exists())
return;
if (file.isDirectory()) {
File[] files = file.listFiles();
if (files != null)
for (int i = 0; i < files.length; i++)
deleteAll(files[i]);
}
file.delete();
}
代码示例来源:origin: com.github.veithen.cosmos.bootstrap/org.eclipse.equinox.p2.core
public static void deleteAll(File file) {
if (!file.exists())
return;
if (file.isDirectory()) {
File[] files = file.listFiles();
if (files != null)
for (int i = 0; i < files.length; i++)
deleteAll(files[i]);
}
file.delete();
}
代码示例来源:origin: org.eclipse.equinox.p2/core
public static void deleteAll(File file) {
if (!file.exists())
return;
if (file.isDirectory()) {
File[] files = file.listFiles();
if (files != null)
for (int i = 0; i < files.length; i++)
deleteAll(files[i]);
}
file.delete();
}
代码示例来源:origin: org.eclipse.tycho/org.eclipse.tycho.p2.resolver.impl
public void deactivateManager() {
agent.stop();
// TODO use IOUtils
FileUtils.deleteAll(agentDir);
}
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.equinox.p2.engine
private void deleteProfile(String profileId) {
File profileDirectory = getProfileFolder(profileId);
FileUtils.deleteAll(profileDirectory);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.equinox.p2.engine
private void deleteProfile(String profileId) {
File profileDirectory = getProfileFolder(profileId);
FileUtils.deleteAll(profileDirectory);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.equinox.p2.core
public static void copy(File source, File destination, File root, boolean overwrite) throws IOException {
File sourceFile = new File(source, root.getPath());
if (!sourceFile.exists())
throw new FileNotFoundException("Source: " + sourceFile + " does not exist"); //$NON-NLS-1$//$NON-NLS-2$
File destinationFile = new File(destination, root.getPath());
if (destinationFile.exists())
if (overwrite)
deleteAll(destinationFile);
else
throw new IOException("Destination: " + destinationFile + " already exists"); //$NON-NLS-1$//$NON-NLS-2$
if (sourceFile.isDirectory()) {
destinationFile.mkdirs();
File[] list = sourceFile.listFiles();
for (int i = 0; i < list.length; i++)
copy(source, destination, new File(root, list[i].getName()), false);
} else {
destinationFile.getParentFile().mkdirs();
try (InputStream in = new BufferedInputStream(new FileInputStream(sourceFile)); OutputStream out = new BufferedOutputStream(new FileOutputStream(destinationFile));) {
copyStream(in, false, out, false);
}
}
}
代码示例来源:origin: com.github.veithen.cosmos.bootstrap/org.eclipse.equinox.p2.core
deleteAll(destinationFile);
else
throw new IOException("Destination: " + destinationFile + " already exists"); //$NON-NLS-1$//$NON-NLS-2$
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.equinox.p2.core
deleteAll(destinationFile);
else
throw new IOException("Destination: " + destinationFile + " already exists"); //$NON-NLS-1$//$NON-NLS-2$
代码示例来源:origin: org.eclipse.equinox.p2/core
deleteAll(destinationFile);
else
throw new IOException("Destination: " + destinationFile + " already exists"); //$NON-NLS-1$//$NON-NLS-2$
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.equinox.p2.engine
public synchronized void removeProfile(String id, long timestamp) throws ProvisionException {
if (SELF.equals(id))
id = self;
if (profiles != null) {
IProfile profile = getProfile(id);
if (profile != null && profile.getTimestamp() == timestamp)
throw new ProvisionException(Messages.SimpleProfileRegistry_CannotRemoveCurrentSnapshot);
}
File profileDirectory = getProfileFolder(id);
if (!profileDirectory.isDirectory())
return;
File profileFile = new File(profileDirectory, Long.toString(timestamp) + PROFILE_GZ_EXT);
if (!profileFile.exists()) {
profileFile = new File(profileDirectory, Long.toString(timestamp) + PROFILE_EXT);
if (!profileFile.exists())
return;
}
FileUtils.deleteAll(profileFile);
// Ignore the return value here. If there was a problem removing the profile state
// properties we don't want to fail the whole operation since the profile state itself
// was removed successfully
removeProfileStateProperties(id, timestamp, null);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.equinox.p2.engine
@Override
public synchronized void removeProfile(String id, long timestamp) throws ProvisionException {
if (SELF.equals(id))
id = self;
if (profiles != null) {
IProfile profile = getProfile(id);
if (profile != null && profile.getTimestamp() == timestamp)
throw new ProvisionException(Messages.SimpleProfileRegistry_CannotRemoveCurrentSnapshot);
}
File profileDirectory = getProfileFolder(id);
if (!profileDirectory.isDirectory())
return;
File profileFile = new File(profileDirectory, Long.toString(timestamp) + PROFILE_GZ_EXT);
if (!profileFile.exists()) {
profileFile = new File(profileDirectory, Long.toString(timestamp) + PROFILE_EXT);
if (!profileFile.exists())
return;
}
FileUtils.deleteAll(profileFile);
// Ignore the return value here. If there was a problem removing the profile state
// properties we don't want to fail the whole operation since the profile state itself
// was removed successfully
removeProfileStateProperties(id, timestamp, null);
}
代码示例来源:origin: com.github.veithen.cosmos.bootstrap/org.eclipse.equinox.p2.publisher.eclipse
@Override
public IStatus perform(IPublisherInfo publisherinfo, IPublisherResult result, IProgressMonitor monitor) {
setPublisherInfo(publisherinfo);
ExecutablesDescriptor brandedExecutables = brandExecutables(executables);
try {
if (publishExecutableIU(brandedExecutables, result))
publishExecutableCU(brandedExecutables, result);
publishExecutableSetter(brandedExecutables, result);
} finally {
if (brandedExecutables.isTemporary())
FileUtils.deleteAll(brandedExecutables.getLocation());
}
return Status.OK_STATUS;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.equinox.p2.publisher.eclipse
@Override
public IStatus perform(IPublisherInfo publisherinfo, IPublisherResult result, IProgressMonitor monitor) {
setPublisherInfo(publisherinfo);
ExecutablesDescriptor brandedExecutables = brandExecutables(executables);
try {
if (publishExecutableIU(brandedExecutables, result))
publishExecutableCU(brandedExecutables, result);
publishExecutableSetter(brandedExecutables, result);
} finally {
if (brandedExecutables.isTemporary())
FileUtils.deleteAll(brandedExecutables.getLocation());
}
return Status.OK_STATUS;
}
代码示例来源:origin: org.eclipse.osgi/org.eclipse.equinox.p2.publisher.eclipse
@Override
public IStatus perform(IPublisherInfo publisherinfo, IPublisherResult result, IProgressMonitor monitor) {
setPublisherInfo(publisherinfo);
ExecutablesDescriptor brandedExecutables = brandExecutables(executables);
try {
if (publishExecutableIU(brandedExecutables, result))
publishExecutableCU(brandedExecutables, result);
publishExecutableSetter(brandedExecutables, result);
} finally {
if (brandedExecutables.isTemporary())
FileUtils.deleteAll(brandedExecutables.getLocation());
}
return Status.OK_STATUS;
}
内容来源于网络,如有侵权,请联系作者删除!