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
9cec4744
Commit
9cec4744
authored
Nov 23, 2017
by
Klaus Wölfel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Provide max_file_count option\n to define the maximum number of files to upload at once
parent
d68feb18
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
src/main/java/org/embulk/input/filename/FilenameFileInputPlugin.java
...va/org/embulk/input/filename/FilenameFileInputPlugin.java
+14
-1
No files found.
src/main/java/org/embulk/input/filename/FilenameFileInputPlugin.java
View file @
9cec4744
...
...
@@ -112,6 +112,10 @@ public class FilenameFileInputPlugin implements FileInputPlugin
@ConfigDefault
(
"null"
)
Optional
<
Integer
>
getFileSize
();
@Config
(
"max_file_count"
)
@ConfigDefault
(
"null"
)
Optional
<
Integer
>
getMaxFileCount
();
@Config
(
"follow_symlinks"
)
@ConfigDefault
(
"false"
)
boolean
getFollowSymlinks
();
...
...
@@ -120,6 +124,7 @@ public class FilenameFileInputPlugin implements FileInputPlugin
@ConfigDefault
(
"false"
)
boolean
getIgnoreLastFile
();
List
<
String
>
getFiles
();
void
setFiles
(
List
<
String
>
files
);
...
...
@@ -137,7 +142,15 @@ public class FilenameFileInputPlugin implements FileInputPlugin
PluginTask
task
=
config
.
loadConfig
(
PluginTask
.
class
);
// list files recursively
List
<
String
>
files
=
listFiles
(
task
);
List
<
String
>
files
=
new
ArrayList
<
String
>(
listFiles
(
task
));
Collections
.
sort
(
files
);
// only process <= max_file_count number of files
final
Integer
maxFileCount
=
task
.
getMaxFileCount
().
orNull
();
if
(
maxFileCount
!=
null
&&
files
.
size
()
>
maxFileCount
)
{
files
=
files
.
subList
(
0
,
maxFileCount
);
}
log
.
info
(
"Loading files {}"
,
files
);
task
.
setFiles
(
files
);
...
...
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