Skip to content

Commit 65a403f

Browse files
committed
add support for full resourcedump documents independently and in the capability lists
1 parent 2eaa7f3 commit 65a403f

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

src/main/java/org/openarchives/resourcesync/CapabilityList.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ public CapabilityList(String describedBy, Date lastModified)
2626
this.allowedCapabilities.add(ResourceSync.CAPABILITY_RESOURCEDUMP);
2727
this.allowedCapabilities.add(ResourceSync.CAPABILITY_CHANGELIST);
2828
this.allowedCapabilities.add(ResourceSync.CAPABILITY_CHANGEDUMP);
29+
this.allowedCapabilities.add(ResourceSync.CAPABILITY_CHANGELIST_ARCHIVE);
30+
this.allowedCapabilities.add(ResourceSync.CAPABILITY_CHANGEDUMP_ARCHIVE);
31+
this.allowedCapabilities.add(ResourceSync.CAPABILITY_RESOURCEDUMP_ARCHIVE);
32+
this.allowedCapabilities.add(ResourceSync.CAPABILITY_RESOURCELIST_ARCHIVE);
2933

3034
if (lastModified != null)
3135
{
@@ -130,4 +134,16 @@ public URL setChangeDump(String loc)
130134
return null;
131135
}
132136
}
137+
138+
public URL setChangeListArchive(String loc)
139+
{
140+
try
141+
{
142+
return this.addCapableUrl(loc, ResourceSync.CAPABILITY_CHANGELIST_ARCHIVE);
143+
}
144+
catch (SpecComplianceException e)
145+
{
146+
return null;
147+
}
148+
}
133149
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package org.openarchives.resourcesync;
2+
3+
import com.sun.org.apache.xpath.internal.functions.FuncStringLength;
4+
5+
import java.util.Date;
6+
7+
public class ResourceDump extends UrlSet
8+
{
9+
10+
public ResourceDump(Date from, String resourceSync)
11+
{
12+
super(ResourceSync.CAPABILITY_RESOURCEDUMP);
13+
this.setFrom(from);
14+
if (resourceSync != null)
15+
{
16+
this.addLn(ResourceSync.CAPABILITY_RESOURCESYNC, resourceSync);
17+
}
18+
}
19+
20+
public ResourceDump()
21+
{
22+
this(new Date(), null);
23+
}
24+
25+
public void addResourceZip(URL zip)
26+
{
27+
this.addUrl(zip);
28+
}
29+
30+
public URL addResourceZip(String zipUrl, Date lastMod, String type, long length)
31+
{
32+
URL url = new URL();
33+
url.setLoc(zipUrl);
34+
url.setLastModified(lastMod);
35+
url.setType(type);
36+
url.setLength(length);
37+
this.addResourceZip(url);
38+
return url;
39+
}
40+
}

0 commit comments

Comments
 (0)