org.eclipse.equinox.internal.frameworkadmin.utils.Utils.getSimpleDataFormattedFile()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(4.8k)|赞(0)|评价(0)|浏览(130)

本文整理了Java中org.eclipse.equinox.internal.frameworkadmin.utils.Utils.getSimpleDataFormattedFile()方法的一些代码示例,展示了Utils.getSimpleDataFormattedFile()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.getSimpleDataFormattedFile()方法的具体详情如下:
包路径:org.eclipse.equinox.internal.frameworkadmin.utils.Utils
类名称:Utils
方法名:getSimpleDataFormattedFile

Utils.getSimpleDataFormattedFile介绍

[英]This method will be called for create a backup file.
[中]将调用此方法来创建备份文件。

代码示例

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.equinox.simpleconfigurator.manipulator

private void saveConfiguration(BundleInfo[] configuration, File outputFile, URI installArea, boolean backup) throws IOException {
  if (backup && outputFile.exists()) {
    File backupFile = Utils.getSimpleDataFormattedFile(outputFile);
    if (!outputFile.renameTo(backupFile)) {
      throw new IOException("Fail to rename from (" + outputFile + ") to (" + backupFile + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    }
  }
  org.eclipse.equinox.internal.simpleconfigurator.utils.BundleInfo[] simpleInfos = convertBundleInfos(configuration, installArea);
  // if empty remove the configuration file
  if (simpleInfos == null || simpleInfos.length == 0) {
    if (outputFile.exists()) {
      outputFile.delete();
    }
    File parentDir = outputFile.getParentFile();
    if (parentDir.exists()) {
      parentDir.delete();
    }
    return;
  }
  SimpleConfiguratorManipulatorUtils.writeConfiguration(simpleInfos, outputFile);
  if (CONFIG_LIST.equals(outputFile.getName()) && installArea != null && isSharedInstallSetup(URIUtil.toFile(installArea), outputFile))
    rememberSharedBundlesInfoTimestamp(installArea, outputFile.getParentFile());
}

代码示例来源:origin: org.eclipse.equinox.simpleconfigurator/manipulator

private void saveConfiguration(BundleInfo[] configuration, File outputFile, URI installArea, boolean backup) throws IOException {
  if (backup && outputFile.exists()) {
    File backupFile = Utils.getSimpleDataFormattedFile(outputFile);
    if (!outputFile.renameTo(backupFile)) {
      throw new IOException("Fail to rename from (" + outputFile + ") to (" + backupFile + ")");
    }
  }
  org.eclipse.equinox.internal.simpleconfigurator.utils.BundleInfo[] simpleInfos = convertBundleInfos(configuration, installArea);
  // if empty remove the configuration file
  if (simpleInfos == null || simpleInfos.length == 0) {
    if (outputFile.exists()) {
      outputFile.delete();
    }
    File parentDir = outputFile.getParentFile();
    if (parentDir.exists()) {
      parentDir.delete();
    }
    return;
  }
  SimpleConfiguratorManipulatorUtils.writeConfiguration(simpleInfos, outputFile);
  if (CONFIG_LIST.equals(outputFile.getName()) && installArea != null && isSharedInstallSetup(URIUtil.toFile(installArea), outputFile))
    rememberSharedBundlesInfoTimestamp(installArea, outputFile.getParentFile());
}

代码示例来源:origin: com.github.veithen.cosmos.bootstrap/org.eclipse.equinox.simpleconfigurator.manipulator

private void saveConfiguration(BundleInfo[] configuration, File outputFile, URI installArea, boolean backup) throws IOException {
  if (backup && outputFile.exists()) {
    File backupFile = Utils.getSimpleDataFormattedFile(outputFile);
    if (!outputFile.renameTo(backupFile)) {
      throw new IOException("Fail to rename from (" + outputFile + ") to (" + backupFile + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    }
  }
  org.eclipse.equinox.internal.simpleconfigurator.utils.BundleInfo[] simpleInfos = convertBundleInfos(configuration, installArea);
  // if empty remove the configuration file
  if (simpleInfos == null || simpleInfos.length == 0) {
    if (outputFile.exists()) {
      outputFile.delete();
    }
    File parentDir = outputFile.getParentFile();
    if (parentDir.exists()) {
      parentDir.delete();
    }
    return;
  }
  SimpleConfiguratorManipulatorUtils.writeConfiguration(simpleInfos, outputFile);
  if (CONFIG_LIST.equals(outputFile.getName()) && installArea != null && isSharedInstallSetup(URIUtil.toFile(installArea), outputFile))
    rememberSharedBundlesInfoTimestamp(installArea, outputFile.getParentFile());
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.equinox.frameworkadmin.equinox

File dest = Utils.getSimpleDataFormattedFile(launcherConfigFile);
if (!launcherConfigFile.renameTo(dest))
  throw new IOException(NLS.bind(Messages.exception_failedToRename, launcherConfigFile, dest));

代码示例来源:origin: org.eclipse.equinox.frameworkadmin/equinox

File dest = Utils.getSimpleDataFormattedFile(launcherConfigFile);
if (!launcherConfigFile.renameTo(dest))
  throw new IOException(NLS.bind(Messages.exception_failedToRename, launcherConfigFile, dest));

代码示例来源:origin: org.eclipse.platform/org.eclipse.equinox.frameworkadmin.equinox

File dest = Utils.getSimpleDataFormattedFile(outputFile);
if (!outputFile.renameTo(dest))
  throw new IOException(NLS.bind(Messages.exception_failedToRename, outputFile, dest));

代码示例来源:origin: org.eclipse.equinox.frameworkadmin/equinox

File dest = Utils.getSimpleDataFormattedFile(outputFile);
if (!outputFile.renameTo(dest))
  throw new IOException(NLS.bind(Messages.exception_failedToRename, outputFile, dest));

相关文章