gobblin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [1/2] incubator-gobblin git commit: Fix URI is not absolute issue in SFTP
Date Thu, 27 Jul 2017 08:40:20 GMT
Repository: incubator-gobblin
Updated Branches:
  refs/heads/master 9ff023cd0 -> 574d3e471


Fix URI is not absolute issue in SFTP


Project: http://git-wip-us.apache.org/repos/asf/incubator-gobblin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-gobblin/commit/68634cf3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-gobblin/tree/68634cf3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-gobblin/diff/68634cf3

Branch: refs/heads/master
Commit: 68634cf351a9196e8b1d6cdea1a68b5b507fca5f
Parents: 7f422a3
Author: Kuai Yu <kuyu@linkedin.com>
Authored: Thu Jul 27 01:07:41 2017 -0700
Committer: Kuai Yu <kuyu@linkedin.com>
Committed: Thu Jul 27 01:07:41 2017 -0700

----------------------------------------------------------------------
 .../gobblin/source/extractor/filebased/FileBasedSource.java  | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-gobblin/blob/68634cf3/gobblin-core/src/main/java/gobblin/source/extractor/filebased/FileBasedSource.java
----------------------------------------------------------------------
diff --git a/gobblin-core/src/main/java/gobblin/source/extractor/filebased/FileBasedSource.java
b/gobblin-core/src/main/java/gobblin/source/extractor/filebased/FileBasedSource.java
index 5ff4fe8..07310af 100644
--- a/gobblin-core/src/main/java/gobblin/source/extractor/filebased/FileBasedSource.java
+++ b/gobblin-core/src/main/java/gobblin/source/extractor/filebased/FileBasedSource.java
@@ -214,11 +214,11 @@ public abstract class FileBasedSource<S, D> extends AbstractSource<S,
D> {
       log.info("Running ls command with input " + path);
       results = this.fsHelper.ls(path);
       for (int i = 0; i < results.size(); i++) {
-        File parsedFile = new File(new URI(results.get(i)));
+        URI uri = new URI(results.get(i));
+        File file = uri.isAbsolute()?
+            new File(uri) : new File(state.getProp(ConfigurationKeys.SOURCE_FILEBASED_DATA_DIRECTORY),
uri.toString());
 
-        String filePath = (parsedFile.isAbsolute()
-            ? parsedFile
-            : new File(state.getProp(ConfigurationKeys.SOURCE_FILEBASED_DATA_DIRECTORY),
parsedFile.toString())).getAbsolutePath();
+        String filePath = file.getAbsolutePath();
         results.set(i, filePath + this.splitPattern + this.fsHelper.getFileMTime(filePath));
       }
     } catch (FileBasedHelperException | URISyntaxException e) {


Mime
View raw message