Commits

Sam Adams  committed ae18b09

pulled out createDepositRequest method

  • Participants
  • Parent commits dc8cd70

Comments (0)

Files changed (1)

File src/main/java/net/chempound/client/cli/command/DepositCommand.java

     @Override
     public void invoke(final GlobalOptions globalOptions) {
 
+        final DepositItemRequest request = createDepositRequest(globalOptions);
+        try {
+            final DepositItemResponse depositReceipt = client.depositItem(request);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+    }
+
+    protected DepositItemRequest createDepositRequest(final GlobalOptions globalOptions) {
         final DepositItemRequest request = new DepositItemRequest();
 
         attachFiles(globalOptions, request);
         setSlug(request);
 
         request.withUri(URI.create(globalOptions.repository));
-        try {
-            final DepositItemResponse depositReceipt = client.depositItem(request);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-
+        return request;
     }
 
     protected void setTitle(final DepositItemRequest request) {