本文整理汇总了Java中org.springframework.util.FileSystemUtils.copyRecursively方法的典型用法代码示例。如果您正苦于以下问题:Java FileSystemUtils.copyRecursively方法的具体用法?Java FileSystemUtils.copyRecursively怎么用?Java FileSystemUtils.copyRecursively使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.util.FileSystemUtils
的用法示例。
在下文中一共展示了FileSystemUtils.copyRecursively方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createProject
import org.springframework.util.FileSystemUtils; //导入方法依赖的package包/类
public ProjectConnection createProject(String name) throws IOException {
File projectDirectory = new File("target/" + name);
projectDirectory.mkdirs();
File gradleScript = new File(projectDirectory, "build.gradle");
if (new File("src/test/resources", name).isDirectory()) {
FileSystemUtils.copyRecursively(new File("src/test/resources", name),
projectDirectory);
}
else {
FileCopyUtils.copy(new File("src/test/resources/" + name + ".gradle"),
gradleScript);
}
GradleConnector gradleConnector = GradleConnector.newConnector();
gradleConnector.useGradleVersion(this.gradleVersion);
((DefaultGradleConnector) gradleConnector).embedded(true);
return gradleConnector.forProjectDirectory(projectDirectory).connect();
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:22,代码来源:ProjectCreator.java
示例2: checkOs
import org.springframework.util.FileSystemUtils; //导入方法依赖的package包/类
@Before
public void checkOs() throws Exception {
Assume.assumeFalse(System.getProperty("os.name").toLowerCase().startsWith("win"));
this.temporaryFolder = this.tmp.newFolder();
TestUtils.prepareLocalRepo();
FileSystemUtils.copyRecursively(file("/projects"), this.temporaryFolder);
}
示例3: setup
import org.springframework.util.FileSystemUtils; //导入方法依赖的package包/类
@Before
public void setup() throws Exception {
this.temporaryFolder = this.tmp.newFolder();
this.springCloudConsulProject = new File(AcceptanceTests.class.getResource("/projects/spring-cloud-consul").toURI());
TestUtils.prepareLocalRepo();
FileSystemUtils.copyRecursively(file("/projects/"), this.temporaryFolder);
}
示例4: customMetadata
import org.springframework.util.FileSystemUtils; //导入方法依赖的package包/类
@Test
public void customMetadata() throws Exception {
System.setProperty("grape.root", "target");
FileSystemUtils.copyRecursively(
new File("src/test/resources/grab-samples/repository"),
new File("target/repository"));
this.cli.grab("customDependencyManagement.groovy", "--autoconfigure=false");
assertThat(new File("target/repository/javax/ejb/ejb-api/3.0").isDirectory())
.isTrue();
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:11,代码来源:GrabCommandIntegrationTests.java
示例5: copyPu
import org.springframework.util.FileSystemUtils; //导入方法依赖的package包/类
private long copyPu(String puPath, File puWorkFolder) throws IOException {
String puDeployPath = context.getServiceBeanManager().getOperationalStringManager().getDeployPath() + "/" + puPath;
File src = new File(puDeployPath);
logger.info("Copying from GSM [" + puDeployPath + "] to " + "[" + deployPath + "] ...");
FileSystemUtils.copyRecursively(src, puWorkFolder);
return src.getTotalSpace();
}
示例6: customMetadata
import org.springframework.util.FileSystemUtils; //导入方法依赖的package包/类
@Test
public void customMetadata() throws Exception {
System.setProperty("grape.root", "target");
FileSystemUtils.copyRecursively(
new File("src/test/resources/grab-samples/repository"),
new File("target/repository"));
this.cli.grab("customDependencyManagement.groovy", "--autoconfigure=false");
assertTrue(new File("target/repository/javax/ejb/ejb-api/3.0").isDirectory());
}
示例7: prepareLocalRepo
import org.springframework.util.FileSystemUtils; //导入方法依赖的package包/类
public static String prepareLocalRepo(String baseDir, String buildDir, String repoPath,
String checkoutDir) throws IOException {
buildDir = baseDir + buildDir;
new File(buildDir).mkdirs();
if (!repoPath.startsWith("/")) {
repoPath = "/" + repoPath;
}
if (!repoPath.endsWith("/")) {
repoPath = repoPath + "/";
}
File source = new File(baseDir + "src/test/resources" + repoPath);
File dest = new File(buildDir + repoPath);
if (dest.exists()) {
FileUtils.delete(dest, FileUtils.RECURSIVE | FileUtils.RETRY);
}
FileSystemUtils.copyRecursively(source, dest);
File dotGit = new File(buildDir + repoPath + ".git");
File git = new File(buildDir + repoPath + "git");
if (git.exists()) {
if (dotGit.exists()) {
FileUtils.delete(dotGit, FileUtils.RECURSIVE);
}
}
git.renameTo(dotGit);
File local = new File(checkoutDir);
if (local.exists()) {
FileUtils.delete(local, FileUtils.RECURSIVE);
}
if (!buildDir.startsWith("/")) {
buildDir = "./" + buildDir;
}
return "file:" + buildDir + repoPath;
}
示例8: prepareLocalSvnRepo
import org.springframework.util.FileSystemUtils; //导入方法依赖的package包/类
public static String prepareLocalSvnRepo(String sourceDir, String checkoutDir) throws Exception {
File sourceDirFile = new File(sourceDir);
sourceDirFile.mkdirs();
File local = new File(checkoutDir);
if (local.exists()) {
FileUtils.delete(local, FileUtils.RECURSIVE);
}
local.mkdirs();
FileSystemUtils.copyRecursively(sourceDirFile, local);
return StringUtils.cleanPath("file:///" + local.getAbsolutePath());
}
示例9: setup
import org.springframework.util.FileSystemUtils; //导入方法依赖的package包/类
@Before
public void setup() throws Exception {
this.temporaryFolder = this.tmp.newFolder();
FileSystemUtils.copyRecursively(file("/projects/"), this.temporaryFolder);
}
示例10: setup
import org.springframework.util.FileSystemUtils; //导入方法依赖的package包/类
@Before
public void setup() throws Exception {
this.temporaryFolder = this.tmp.newFolder();
TestUtils.prepareLocalRepo();
FileSystemUtils.copyRecursively(file("/projects/"), this.temporaryFolder);
}
示例11: prepareWebApplication
import org.springframework.util.FileSystemUtils; //导入方法依赖的package包/类
private void prepareWebApplication(File deployPath, ClusterInfo clusterInfo, BeanLevelProperties beanLevelProperties) throws Exception {
if (!(new File(deployPath, "WEB-INF/web.xml").exists())) {
return;
}
BootstrapWebApplicationContextListener.prepareForBoot(deployPath, clusterInfo, beanLevelProperties);
// if we download, we can delete JSpaces and jini jars from the WEB-INF/lib (they are already in the
// common class loader).
File webInfLib = new File(deployPath, "WEB-INF/lib");
webInfLib.mkdirs();
if (webInfLib.exists()) {
String gsRequired = Locator.getLibRequired();
String gsOptional = Locator.getLibOptional();
String gsPlatform = Locator.getLibPlatform();
try {
FileSystemUtils.copyRecursively(new File(gsRequired), new File(deployPath, "WEB-INF/lib"));
FileSystemUtils.copyRecursively(new File(gsOptional + "/spring"), new File(deployPath, "WEB-INF/lib"));
FileSystemUtils.copyRecursively(new File(gsOptional + "/security"), new File(deployPath, "WEB-INF/lib"));
if (ScalaIdentifier.isScalaLibInClassPath()) {
FileSystemUtils.copyRecursively(new File(gsPlatform + "/scala/gs-openspaces-scala.jar"), new File(deployPath, "WEB-INF/lib/gs-openspaces-scala.jar"));
}
logger.debug(logMessage("Added spring jars to web application"));
} catch (IOException e) {
// don't copy it
}
File[] wenInfJars = BootIOUtils.listFiles(webInfLib);
ArrayList<String> deleted = new ArrayList<String>();
for (File webInfJarFile : wenInfJars) {
boolean delete = false;
if (webInfJarFile.getName().startsWith("gs-runtime")) {
delete = true;
}
if (delete) {
deleted.add(webInfJarFile.getName());
webInfJarFile.delete();
}
}
if (!deleted.isEmpty()) {
logger.debug(logMessage("Deleted the following jars from the web application: " + deleted));
}
}
}
示例12: copyLocalRepo
import org.springframework.util.FileSystemUtils; //导入方法依赖的package包/类
public static String copyLocalRepo(String path) throws IOException {
File dest = new File(REPO_PREFIX + path);
FileSystemUtils.deleteRecursively(dest);
FileSystemUtils.copyRecursively(new File("target/repos/config-repo"), dest);
return "file:./target/repos/" + path;
}