Github user chtyim commented on a diff in the pull request:
https://github.com/apache/incubator-twill/pull/47#discussion_r32994451
--- Diff:
twill-api/src/main/java/org/apache/twill/api/TwillSpecification.java ---
@@ -241,29 +244,93 @@ public PlacementPolicySetter withPlacementPolicy() {
this.completer = completer;
}
+ /**
+ * @return instance of {@link LocalFileAdder} to add files to a
runnable.
+ */
public LocalFileAdder withLocalFiles() {
return new MoreFile(completer);
}
+ /**
+ * @return instance of {@link RunnableSetter} that could be used to
add runnables.
+ */
public RunnableSetter noLocalFiles() {
return completer.complete(Collections.<LocalFile>emptyList());
}
}
+ /**
+ * Define methods to add local files to be included in a runnable.
+ */
public interface LocalFileAdder {
- MoreFile add(String name, File file);
+ /**
+ * Add local file to a runnable.
+ *
+ * @param name name of the file for local access.
+ * @param file the actual {@link File} to be added.
+ * @return instance of {@link LocalFileAdder}
+ */
+ LocalFileAdder add(String name, File file);
- MoreFile add(String name, URI uri);
+ /**
+ * Add local file to a runnable.
+ *
+ * @param name name of the file for local access.
+ * @param uri the {@link URI} for the file to be added.
+ * @return instance of {@link LocalFileAdder}
+ */
+ LocalFileAdder add(String name, URI uri);
- MoreFile add(String name, File file, boolean archive);
+ /**
+ * Add local file to a runnable using {@link File}.
+ *
+ * @param name name of the file for local access.
+ * @param file the actual {@link File} to be included.
+ * @param archive if it is an archive file.
+ * @return instance of {@link LocalFileAdder}
+ */
+ LocalFileAdder add(String name, File file, boolean archive);
- MoreFile add(String name, URI uri, boolean archive);
+ /**
+ * Add local file to a runnable using {@link URI}.
+ *
+ * @param name name of the file for local access.
+ * @param uri the {@link URI} for the file to be added.
+ * @param archive if it is an archive file.
+ * @return instance of {@link LocalFileAdder}
+ */
+ LocalFileAdder add(String name, URI uri, boolean archive);
- MoreFile add(String name, File file, String pattern);
+ /**
+ * Add local file to a runnable using {@link File} with filter
pattern.
+ *
+ * @param name name of the file for local access.
+ * @param file the actual {@link File} to be added.
+ * @param pattern the filter pattern to include the files.
+ * @return instance of {@link LocalFileAdder}
+ */
+ LocalFileAdder add(String name, File file, String pattern);
- MoreFile add(String name, URI uri, String pattern);
+ /**
+ * Add local file to a runnable using {@link File} with filter
pattern.
+ *
+ * @param name name of the file for local access.
+ * @param uri the {@link URI} for the file to be added.
+ * @param pattern the filter pattern to include the files.
+ * @return instance of {@link LocalFileAdder}
+ */
+ LocalFileAdder add(String name, URI uri, String pattern);
+
+ /**
+ * Apply the local files into an instance of {@link RunnableSetter}
to add runnables with local files.
+ * @return instance of {@link RunnableSetter} with local files.
+ */
+ RunnableSetter apply();
--- End diff --
It was intentionally to not have the apply() method defined in this
interface so that at least one file is added before apply() can be called.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---