Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
embulk-input-filename
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Klaus Wölfel
embulk-input-filename
Commits
91ce19bf
Commit
91ce19bf
authored
Mar 18, 2017
by
Klaus Wölfel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not skib directories of last_path files
parent
2463a54a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
src/main/java/org/embulk/input/filename/FilenameFileInputPlugin.java
...va/org/embulk/input/filename/FilenameFileInputPlugin.java
+10
-10
No files found.
src/main/java/org/embulk/input/filename/FilenameFileInputPlugin.java
View file @
91ce19bf
...
...
@@ -118,12 +118,12 @@ public class FilenameFileInputPlugin
{
if
(
path
.
equals
(
directory
))
{
return
FileVisitResult
.
CONTINUE
;
}
else
if
(
lastPath
!=
null
&&
path
.
toString
().
compareTo
(
lastPath
)
<=
0
)
{
}
else
if
(
lastPath
!=
null
&&
path
.
toString
().
compareTo
(
lastPath
.
substring
(
0
,
path
.
toString
().
length
()))
<
0
)
{
return
FileVisitResult
.
SKIP_SUBTREE
;
}
else
if
(
path
.
getFileName
().
toString
().
startsWith
(
"."
))
{
return
FileVisitResult
.
SKIP_SUBTREE
;
}
else
{
// Skip hidden
if
(!
path
.
getFileName
().
toString
().
startsWith
(
"."
)
&&
path
.
getFileName
().
toString
().
startsWith
(
fileNamePrefix
))
{
if
(
path
.
getFileName
().
toString
().
startsWith
(
fileNamePrefix
))
{
return
FileVisitResult
.
CONTINUE
;
}
else
{
return
FileVisitResult
.
SKIP_SUBTREE
;
...
...
@@ -131,21 +131,21 @@ public class FilenameFileInputPlugin
}
}
@Override
public
FileVisitResult
visitFile
(
Path
path
,
BasicFileAttributes
attrs
)
{
if
(
lastPath
!=
null
&&
path
.
toString
().
compareTo
(
lastPath
)
<=
0
)
{
return
FileVisitResult
.
CONTINUE
;
}
else
if
(
path
.
getFileName
().
toString
().
startsWith
(
"."
))
{
return
FileVisitResult
.
CONTINUE
;
}
else
{
// Skip hidden
if
(!
path
.
getFileName
().
toString
().
startsWith
(
"."
)
&&
path
.
getFileName
().
toString
().
startsWith
(
fileNamePrefix
))
{
if
(
path
.
getFileName
().
toString
().
startsWith
(
fileNamePrefix
))
{
builder
.
add
(
path
.
toString
());
return
FileVisitResult
.
CONTINUE
;
}
}
return
FileVisitResult
.
CONTINUE
;
}
}
}
});
}
catch
(
IOException
ex
)
{
throw
new
RuntimeException
(
String
.
format
(
"Failed get a list of local files at '%s'"
,
directory
),
ex
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment