Package org.dspace.license
Class LicenseCleanup
- java.lang.Object
-
- org.dspace.license.LicenseCleanup
-
public class LicenseCleanup extends Object
Cleanup class for CC Licenses, corrects XML formatting errors by replacing the license_rdf bitstream.- Author:
- mdiggory
-
-
Field Summary
Fields Modifier and Type Field Description protected static BitstreamServicebitstreamServiceprotected static BundleServicebundleServiceprotected static ItemServiceitemServiceprotected static Templatestemplates
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]copy(Context context, Bitstream b)Fast stream copy routineprotected static voidhandleItem(Context context, Item item)Process Item, correcting CC-License if encountered.static voidmain(String[] args)
-
-
-
Field Detail
-
templates
protected static final Templates templates
-
bitstreamService
protected static final BitstreamService bitstreamService
-
bundleService
protected static final BundleService bundleService
-
itemService
protected static final ItemService itemService
-
-
Method Detail
-
main
public static void main(String[] args) throws SQLException, AuthorizeException, IOException
- Parameters:
args- the command line arguments given- Throws:
SQLException- if database errorIOException- if IO errorAuthorizeException- if authorization error
-
handleItem
protected static void handleItem(Context context, Item item) throws SQLException, AuthorizeException, IOException
Process Item, correcting CC-License if encountered.- Parameters:
context- The relevant DSpace Context.item- The item to process- Throws:
SQLException- if database errorAuthorizeException- if authorization errorIOException- if IO error
-
copy
public static byte[] copy(Context context, Bitstream b) throws IOException, SQLException, AuthorizeException
Fast stream copy routine- Parameters:
context- The relevant DSpace Context.b- the Bitstream to be copied.- Returns:
- copy of the content of
b. - Throws:
IOException- if IO errorSQLException- if database errorAuthorizeException- if authorization error
-
-