本文整理汇总了Java中gov.nih.nci.cagrid.common.Utils.copyFile方法的典型用法代码示例。如果您正苦于以下问题:Java Utils.copyFile方法的具体用法?Java Utils.copyFile怎么用?Java Utils.copyFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gov.nih.nci.cagrid.common.Utils
的用法示例。
在下文中一共展示了Utils.copyFile方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: runStep
import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
public void runStep() throws Throwable {
File libDir = new File(info.getDir(), "lib");
// find the testing jar
boolean jarsCopied = false;
LOGGER.debug("Installing data tests jar to class loader");
assertTrue("Class loader was not a URLClassLoader", getClass().getClassLoader() instanceof URLClassLoader);
URLClassLoader currentClassLoader = (URLClassLoader) getClass().getClassLoader();
URL[] urls = currentClassLoader.getURLs();
for (URL u : urls) {
URI uri = u.toURI();
LOGGER.debug("CLASSPATH URI: " + uri.toString());
if (uri.getScheme().equalsIgnoreCase("file")) {
// is a file
File classpathFile = new File(uri);
String name = classpathFile.getName();
if (name.endsWith(".jar") && name.startsWith(DATA_TESTS_JAR_PREFIX)) {
// found the data tests jar file
// copy the jar to the service's lib dir
File libOut = new File(libDir, classpathFile.getName());
Utils.copyFile(classpathFile, libOut);
jarsCopied = true;
}
}
}
assertTrue("Could not locate caGrid-dataTests jar on classpath", jarsCopied);
}
示例2: copySchemas
import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
private void copySchemas() throws CreationExtensionException {
// copy over the [Cql2]TransferDataService.wsdl files
String serviceSchemaDir = getServiceSchemaDir();
File dataExtensionSchemaDir = new File(ExtensionsLoader.getInstance().getExtensionsDir(),
"data" + File.separator + "schema" + File.separator + "Data");
File[] transferWsdls = dataExtensionSchemaDir.listFiles(new FileFilter() {
public boolean accept(File pathname) {
return pathname.getName().endsWith("TransferDataService.wsdl");
}
});
for (File wsdl : transferWsdls) {
File wsdlOutFile = new File(serviceSchemaDir, wsdl.getName());
try {
Utils.copyFile(wsdl, wsdlOutFile);
} catch (Exception ex) {
throw new CreationExtensionException("Error copying transfer data service wsdls: " + ex.getMessage(), ex);
}
}
}
示例3: runStep
import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
public void runStep() throws Throwable {
System.out.println("Adding a simple transfer method implementation.");
File inFileClient = new File(".." + File.separator + ".." + File.separator + ".."
+ File.separator + "integration-tests" + File.separator + "projects" + File.separator + "transferTests"
+ File.separator + "resources" + File.separator + "Streaming"+ tci.getName() + "Client.java");
File outFileClient = new File(tci.getDir() + File.separator + "src" + File.separator + tci.getPackageDir()
+ File.separator + "client" + File.separator + tci.getName() + "Client.java");
Utils.copyFile(inFileClient, outFileClient);
File inFileImpl = new File(".." + File.separator + ".." + File.separator + ".."
+ File.separator + "integration-tests" + File.separator + "projects" + File.separator + "transferTests"
+ File.separator + "resources" + File.separator + "Streaming"+ tci.getName() + "Impl.java");
File outFileImpl = new File(tci.getDir() + File.separator + "src" + File.separator + tci.getPackageDir()
+ File.separator + "service" + File.separator + tci.getName() + "Impl.java");
SourceUtils.modifyImpl(inFileImpl, outFileImpl, "reateStreamingTransferMethodStep");
buildStep();
}
示例4: copyLibraries
import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
private void copyLibraries(ServiceInformation info) throws Exception {
String toDir = getServiceLibDir(info);
File directory = new File(toDir);
if (!directory.exists()) {
directory.mkdirs();
}
// from the lib directory
File[] libs = extensionLibDir.listFiles();
File[] copiedLibs = new File[libs.length];
if (libs != null) {
for (int i = 0; i < libs.length; i++) {
File outFile = new File(toDir + File.separator + libs[i].getName());
copiedLibs[i] = outFile;
Utils.copyFile(libs[i], outFile);
}
}
modifyClasspathFile(copiedLibs, info);
}
示例5: copySchemasToService
import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
private void copySchemasToService(ServiceExtensionDescriptionType desc, ServiceInformation info)
throws CreationExtensionException {
File extensionSchemaDir = getExtensionSchemaDir(desc);
File serviceSchemasDir = new File(info.getBaseDirectory().getAbsolutePath() + File.separator + "schema"
+ File.separator + info.getServices().getService(0).getName());
File[] sourceSchemas = extensionSchemaDir.listFiles(new FileFilters.XSDFileFilter());
for (File source : sourceSchemas) {
if (source.isFile()) {
File outFile = new File(serviceSchemasDir.getAbsolutePath()
+ File.separator + source.getName());
try {
Utils.copyFile(source, outFile);
} catch (IOException ex) {
throw new CreationExtensionException("Error copying schema file "
+ source.getAbsolutePath(), ex);
}
}
}
}
示例6: upgrade
import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
protected void upgrade() throws Exception {
// need to replace the build.xml
Utils.copyFile(new File(getServicePath() + File.separator + "build.xml"), new File(getServicePath()
+ File.separator + "build.xml.OLD"));
Utils.copyFile(new File(getServicePath() + File.separator + "build-deploy.xml"), new File(getServicePath()
+ File.separator + "build-deploy.xml.OLD"));
Utils.copyFile(new File(getServicePath() + File.separator + "run-tools.xml"), new File(getServicePath()
+ File.separator + "run-tools.xml.OLD"));
Utils.copyFile(new File("." + File.separator + "skeleton" + File.separator + "build.xml"), new File(
getServicePath() + File.separator + "build.xml"));
Utils.copyFile(new File("." + File.separator + "skeleton" + File.separator + "build-deploy.xml"), new File(
getServicePath() + File.separator + "build-deploy.xml"));
RunToolsTemplate runToolsT = new RunToolsTemplate();
String runToolsS = runToolsT.generate(new SpecificServiceInformation(getServiceInformation(),
getServiceInformation().getServices().getService(0)));
File runToolsF = new File(getServicePath() + File.separator + "run-tools.xml");
FileWriter runToolsFW = new FileWriter(runToolsF);
runToolsFW.write(runToolsS);
runToolsFW.close();
getStatus().addDescriptionLine("replaced run-tools.xml, build.xml, and build-deploy.xml with new version");
upgradeJars();
fixDevBuildDeploy();
fixSource();
fixWSDD();
fixSecurityOnMetadataAccessProviders();
getStatus().setStatus(StatusBase.UPGRADE_OK);
}
示例7: upgradeWsdls
import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
private void upgradeWsdls() throws UpgradeException {
// get the service's schema dir where the wsdl files live
String serviceName = getServiceInformation().getServiceDescriptor()
.getServices().getService(0).getName();
File serviceSchemasDir = new File(getServicePath(), "schema" + File.separator + serviceName);
// get the data service schemas dir
File dataSchemasDir = getDataSchemaDir();
// find data wsdls
Map<String, File> dataWsdlsByName = new HashMap<String, File>();
for (File file : dataSchemasDir.listFiles()) {
String name = file.getName();
if (name.endsWith(".wsdl")) {
dataWsdlsByName.put(name, file);
}
}
// list wsdls in service schemas dir. If any match one from data, replace it with the new version
File[] serviceWsdls = serviceSchemasDir.listFiles(new FileFilter() {
public boolean accept(File path) {
return path.getName().endsWith(".wsdl");
}
});
for (File serviceWsdl : serviceWsdls) {
if (dataWsdlsByName.containsKey(serviceWsdl.getName())) {
// overwrite the service wsdl with the new one
try {
Utils.copyFile(dataWsdlsByName.get(serviceWsdl.getName()), serviceWsdl);
getStatus().addDescriptionLine("Replaced WSDL " + serviceWsdl.getName()
+ " with new version " + UpgraderConstants.DATA_CURRENT_VERSION);
} catch (Exception ex) {
throw new UpgradeException("Error replacing wsdl: " + ex.getMessage(), ex);
}
}
}
}
示例8: runStep
import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
public void runStep() throws Throwable {
System.out.println("Adding a simple methods implementation.");
File inFileClient = new File(Utils.decodeUrl(this.getClass().getResource("/gold/persistence/" + tci.getName() + "ClientGetPersistentResource.java")));
File outFileClient = new File(tci.getDir() + File.separator + "src" + File.separator + tci.getPackageDir()
+ File.separator + "client" + File.separator + tci.getName() + "Client.java");
Utils.copyFile(inFileClient, outFileClient);
buildStep();
}
示例9: upgrade
import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
protected void upgrade() throws Exception {
// need to replace the build.xml
Utils.copyFile(new File(getServicePath() + File.separator + "build.xml"), new File(getServicePath()
+ File.separator + "build.xml.OLD"));
Utils.copyFile(new File(getServicePath() + File.separator + "build-deploy.xml"), new File(getServicePath()
+ File.separator + "build-deploy.xml.OLD"));
Utils.copyFile(new File(getServicePath() + File.separator + "run-tools.xml"), new File(getServicePath()
+ File.separator + "run-tools.xml.OLD"));
Utils.copyFile(new File("." + File.separator + "skeleton" + File.separator + "build.xml"), new File(
getServicePath() + File.separator + "build.xml"));
Utils.copyFile(new File("." + File.separator + "skeleton" + File.separator + "build-deploy.xml"), new File(
getServicePath() + File.separator + "build-deploy.xml"));
RunToolsTemplate runToolsT = new RunToolsTemplate();
String runToolsS = runToolsT.generate(new SpecificServiceInformation(getServiceInformation(),getServiceInformation().getServices().getService(0)));
File runToolsF = new File(getServicePath() + File.separator + "run-tools.xml");
FileWriter runToolsFW = new FileWriter(runToolsF);
runToolsFW.write(runToolsS);
runToolsFW.close();
getStatus().addDescriptionLine("replaced run-tools.xml, build.xml, and build-deploy.xml with new version");
upgradeJars();
fixDevBuildDeploy();
fixSource();
fixWSDD();
fixSecurityOnMetadataAccessProviders();
getStatus().setStatus(StatusBase.UPGRADE_OK);
}
示例10: runStep
import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
public void runStep() throws Throwable {
System.out.println("Copying user proxys to services dir");
File inFileClient = new File(container.getCertificatesDirectory(),
"ca" + File.separator + "testing_ca_cert.0");
File outFileClient = new File(tci.getDir(), "caCert.0");
Utils.copyFile(inFileClient, outFileClient);
}
示例11: setSelectedDomainModelFilename
import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
private void setSelectedDomainModelFilename(String filename) {
// set the selected file on the data extension's info
try {
ModelInformation info = getModelInformation();
ResourcePropertyType dmResourceProp = getDomainModelResourceProperty();
if (filename != null) {
File selectedFile = new File(filename);
File localDomainFile = new File(getServiceInformation().getBaseDirectory().getAbsolutePath()
+ File.separator + "etc" + File.separator + selectedFile.getName());
Utils.copyFile(selectedFile, localDomainFile);
dmResourceProp.setPopulateFromFile(true);
dmResourceProp.setFileLocation(localDomainFile.getName());
info.setSource(ModelSourceType.preBuilt);
storeModelInformation(info);
loadDomainModelFile();
} else {
dmResourceProp.setPopulateFromFile(false);
dmResourceProp.setFileLocation("");
}
} catch (Exception ex) {
ex.printStackTrace();
CompositeErrorDialog.showErrorDialog("Error copying selected file to service", ex);
}
}
示例12: runStep
import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
public void runStep() throws Throwable {
System.out.println("Adding a simple methods implementation.");
File inFileClient = new File(Utils.decodeUrl(this.getClass().getResource("/gold/persistence/" + tci.getName() + "ClientGet.java")));
File outFileClient = new File(tci.getDir() + File.separator + "src" + File.separator + tci.getPackageDir()
+ File.separator + "client" + File.separator + tci.getName() + "Client.java");
Utils.copyFile(inFileClient, outFileClient);
buildStep();
}
示例13: copyIntroduceSchemasFromExtensionDir
import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
protected void copyIntroduceSchemasFromExtensionDir(String[] schemaNames, File outputDir) throws IOException {
for (String schemaName : schemaNames) {
File schemaFile = new File(ExtensionsLoader.getInstance().getExtensionsDir(),
Constants.EXTENSION_NAME + File.separator + "schema" + File.separator + schemaName);
LOG.debug("Copying schema from " + schemaFile.getAbsolutePath());
File outputFile = new File(outputDir, schemaName);
LOG.debug("Saving schema to " + outputFile.getAbsolutePath());
Utils.copyFile(schemaFile, outputFile);
}
}
示例14: runStep
import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
public void runStep() throws Throwable {
assertTrue("Container must be Tomcat", container instanceof TomcatServiceContainer || container instanceof Tomcat6ServiceContainer);
File webappsDir = new File(container.getProperties().getContainerDirectory(), "webapps");
File exampleProjectWar = new File(ExampleProjectInfo.getExampleProjectDir(),
"target" + File.separator + "dist" + File.separator +
"exploded" + File.separator + "output" + File.separator +
ExampleProjectInfo.EXAMPLE_PROJECT_NAME + File.separator + "package" + File.separator +
"server" + File.separator + "tomcat" + File.separator +
"webapps" + File.separator + ExampleProjectInfo.EXAMPLE_PROJECT_NAME + ".war");
assertTrue("Project WAR file not found (" + exampleProjectWar.getAbsolutePath() + ")", exampleProjectWar.exists());
Utils.copyFile(exampleProjectWar, new File(webappsDir, exampleProjectWar.getName()));
}
示例15: copySchema
import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
private void copySchema(String schemaName, String outputDir) throws Exception {
File schemaFile = new File(ExtensionsLoader.EXTENSIONS_DIRECTORY + File.separator
+ MetadataConstants.EXTENSION_NAME + File.separator + "schema" + File.separator + schemaName);
System.out.println("Copying schema from " + schemaFile.getAbsolutePath());
File outputFile = new File(outputDir + File.separator + schemaName);
System.out.println("Saving schema to " + outputFile.getAbsolutePath());
Utils.copyFile(schemaFile, outputFile);
}