Sam Adams avatar Sam Adams committed 4ca23c4

Renamed ContentLoad* to Deposit*

Comments (0)

Files changed (3)

src/main/java/uk/ac/cam/ch/wwmm/chempound/deposit/DepositClient.java

 package uk.ac.cam.ch.wwmm.chempound.deposit;
 
 import org.swordapp.client.*;
-import uk.ac.cam.ch.wwmm.chempound.content.ContentLoadRequest;
+import uk.ac.cam.ch.wwmm.chempound.content.DepositRequest;
 
 import java.io.IOException;
 import java.net.URI;
     }
 
     private Deposit prepareSwordDeposit() throws IOException {
-        ContentLoadRequest depositRequest = getDepositRequest();
+        DepositRequest depositRequest = getDepositRequest();
         return SwordUtil.createSwordDeposit(depositRequest);
     }
 
-    protected abstract ContentLoadRequest getDepositRequest();
+    protected abstract DepositRequest getDepositRequest();
 
 }

src/main/java/uk/ac/cam/ch/wwmm/chempound/deposit/DepositCollection.java

 package uk.ac.cam.ch.wwmm.chempound.deposit;
 
-import com.hp.hpl.jena.rdf.model.Statement;
 import com.hp.hpl.jena.vocabulary.RDF;
-import com.hp.hpl.jena.xmloutput.RDFXMLWriterI;
-import com.hp.hpl.jena.xmloutput.impl.Abbreviated;
-import org.apache.abdera.Abdera;
-import org.apache.abdera.model.Document;
-import org.swordapp.client.Deposit;
 import org.swordapp.client.DepositReceipt;
-import org.swordapp.client.EntryPart;
-import org.swordapp.client.SWORDClient;
-import uk.ac.cam.ch.wwmm.chempound.content.ContentLoadRequest;
-import uk.ac.cam.ch.wwmm.chempound.content.DefaultContentLoadRequest;
+import uk.ac.cam.ch.wwmm.chempound.content.DepositRequest;
+import uk.ac.cam.ch.wwmm.chempound.content.DefaultDepositRequest;
 import uk.ac.cam.ch.wwmm.chempound.rdf.CPTerms;
-import uk.ac.cam.ch.wwmm.chempound.rdf.DCTerms;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
 
 /**
  * @author sea36
     }
 
     @Override
-    protected ContentLoadRequest getDepositRequest() {
-        ContentLoadRequest request = new DefaultContentLoadRequest();
+    protected DepositRequest getDepositRequest() {
+        DepositRequest request = new DefaultDepositRequest();
         request.setSlug(id);
         request.getResourceMetadata().setTitle(title);
         request.getResourceMetadata().addProperty(RDF.type, CPTerms.Collection);

src/main/java/uk/ac/cam/ch/wwmm/chempound/deposit/SwordUtil.java

 import org.swordapp.client.Deposit;
 import org.swordapp.client.EntryPart;
 import org.swordapp.client.UriRegistry;
-import uk.ac.cam.ch.wwmm.chempound.content.ContentLoadRequest;
+import uk.ac.cam.ch.wwmm.chempound.content.DepositRequest;
 import uk.ac.cam.ch.wwmm.chempound.rdf.DCTerms;
 import uk.ac.cam.ch.wwmm.chempound.storage.DepositResource;
 import uk.ac.cam.ch.wwmm.chempound.storage.LocalResource;
  */
 public class SwordUtil {
 
-    public static Deposit createSwordDeposit(ContentLoadRequest request) throws IOException {
+    public static Deposit createSwordDeposit(DepositRequest request) throws IOException {
         Deposit deposit = new Deposit();
 
         EntryPart entryPart = new EntryPart();
         return deposit;
     }
 
-    private static Statement getTitleStatement(ContentLoadRequest request) {
+    private static Statement getTitleStatement(DepositRequest request) {
         Statement s = request.getResourceMetadata().getProperty(DCTerms.title);
         if (s == null) {
             s = request.getResourceMetadata().getProperty(DC.title);
         return s;
     }
 
-    private static byte[] createZipFile(ContentLoadRequest request) throws IOException {
+    private static byte[] createZipFile(DepositRequest request) throws IOException {
         ByteArrayOutputStream buffer = new ByteArrayOutputStream();
         ZipOutputStream out = new ZipOutputStream(buffer);
         int n = 0;
         return buffer.toByteArray();
     }
 
-    private static void attachMetaData(ContentLoadRequest request, EntryPart entryPart) {
+    private static void attachMetaData(DepositRequest request, EntryPart entryPart) {
         ByteArrayOutputStream buffer = new ByteArrayOutputStream();
 
         RDFXMLWriterI w = new Abbreviated();
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.