Commits

Sam Adams  committed 4ca23c4

Renamed ContentLoad* to Deposit*

  • Participants
  • Parent commits eb40379

Comments (0)

Files changed (3)

File 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();
 
 }

File 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);

File 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();