Java Code Examples for org.springframework.data.hadoop.fs.FsShell#test()
The following examples show how to use
org.springframework.data.hadoop.fs.FsShell#test() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AppDeployerIT.java From spring-cloud-deployer-yarn with Apache License 2.0 | 5 votes |
private void copyFile(Resource artifact, String dir) throws Exception { File tmp = File.createTempFile(UUID.randomUUID().toString(), null); FileCopyUtils.copy(artifact.getInputStream(), new FileOutputStream(tmp)); @SuppressWarnings("resource") FsShell shell = new FsShell(getConfiguration()); String artifactPath = dir + artifact.getFile().getName(); if (!shell.test(artifactPath)) { shell.copyFromLocal(tmp.getAbsolutePath(), dir + artifact.getFile().getName()); } }
Example 2
Source File: TaskLauncherIT.java From spring-cloud-deployer-yarn with Apache License 2.0 | 5 votes |
private void copyFile(Resource artifact, String dir) throws Exception { File tmp = File.createTempFile(UUID.randomUUID().toString(), null); FileCopyUtils.copy(artifact.getInputStream(), new FileOutputStream(tmp)); @SuppressWarnings("resource") FsShell shell = new FsShell(getConfiguration()); String artifactPath = dir + artifact.getFile().getName(); if (!shell.test(artifactPath)) { shell.copyFromLocal(tmp.getAbsolutePath(), dir + artifact.getFile().getName()); } }
Example 3
Source File: DatasetSinkIntegrationTests.java From spring-cloud-stream-app-starters with Apache License 2.0 | 5 votes |
@Before public void setup() throws IOException { FileSystem fs = FileSystem.get(hadoopConfiguration); FsShell fsShell = new FsShell(hadoopConfiguration, fs); if (fsShell.test(testDir)) { fsShell.rmr(testDir); } }