本文整理汇总了Java中gov.nih.nci.cagrid.common.Utils.getTrustedCerificatesDirectory方法的典型用法代码示例。如果您正苦于以下问题:Java Utils.getTrustedCerificatesDirectory方法的具体用法?Java Utils.getTrustedCerificatesDirectory怎么用?Java Utils.getTrustedCerificatesDirectory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gov.nih.nci.cagrid.common.Utils
的用法示例。
在下文中一共展示了Utils.getTrustedCerificatesDirectory方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
public static void main(String[] args) {
if (args.length != 1) {
usage();
System.exit(-1);
} else {
try {
String srcDir = args[0];
File dir = new File(srcDir);
if (dir.exists()) {
File[] list = dir.listFiles();
if (list != null) {
for (int i = 0; i < list.length; i++) {
if (list[i].isFile()) {
File dest = new File(Utils.getTrustedCerificatesDirectory() + File.separator
+ list[i].getName());
copy(list[i], dest);
}
}
}
} else {
System.out.println("The source directory, " + dir.getAbsolutePath() + " does not exist.");
System.exit(-1);
}
} catch (Exception e) {
e.printStackTrace();
System.exit(-1);
}
}
}
示例2: configureGlobusCertificates
import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
private void configureGlobusCertificates() throws Exception {
File globusCertificateDir = Utils.getTrustedCerificatesDirectory();
File gridTargetCertsDir = new File(gaardsConfigurationDirectory, targetGrid + File.separator + "certificates");
Utils.copyDirectory(gridTargetCertsDir, globusCertificateDir);
SyncGTSDefault.setServiceSyncDescriptionLocation(gaardsConfigurationDirectory.getAbsolutePath()
+ File.separator + targetGrid + File.separator
+ "sync-description.xml");
SyncDescription description = SyncGTSDefault.getSyncDescription();
SyncGTS sync = SyncGTS.getInstance();
sync.syncOnce(description);
}
示例3: setDefaultGrid
import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
private void setDefaultGrid() {
try {
File targetGridDirectory = new File(GAARDSApplication.getGAARDSConfigurationDirectory(), grid.getSystemName());
File gridSyncGTDCertsDir = Utils.getTrustedCerificatesDirectory();
File gridTargetCertsDir = new File(targetGridDirectory, "certificates");
Utils.copyDirectory(gridTargetCertsDir, gridSyncGTDCertsDir);
// sync with trust fabric
SyncGTSDefault
.setServiceSyncDescriptionLocation(targetGridDirectory.getAbsolutePath()
+ File.separator + "sync-description.xml");
SyncDescription description = SyncGTSDefault.getSyncDescription();
SyncGTS sync = SyncGTS.getInstance();
sync.syncOnce(description);
// reload
GAARDSApplication.getContext().getConfigurationManager()
.setActiveConfiguration(grid.getSystemName());
GAARDSApplication.getContext().getConfigurationManager().reload();
ServicesManager.getInstance().syncWithUpdatedConfiguration();
GAARDSApplication.setTargetGrid(grid.getSystemName());
} catch (Exception e) {
ErrorDialog.showError(e);
FaultUtil.logFault(log, e);
}
}