Revision 4959
Added by daigle almost 15 years ago
ArchiveHandler.java | ||
---|---|---|
36 | 36 |
|
37 | 37 |
import edu.ucsb.nceas.metacat.service.PropertyService; |
38 | 38 |
import edu.ucsb.nceas.metacat.util.ErrorSendingErrorException; |
39 |
import edu.ucsb.nceas.metacat.util.ErrorUtil; |
|
40 | 39 |
import edu.ucsb.nceas.metacat.util.MetacatUtilException; |
41 | 40 |
import edu.ucsb.nceas.metacat.util.ResponseUtil; |
42 | 41 |
import edu.ucsb.nceas.utilities.FileUtil; |
... | ... | |
108 | 107 |
if (!DocumentImpl.hasReadPermission(user, groups, docid)) { |
109 | 108 |
String errorString = "User " + user + " does not have permission" |
110 | 109 |
+ " to read the document with the docid " + docid; |
111 |
ErrorUtil.sendError(response, ErrorUtil.NO_READ_PERMISSION, errorString);
|
|
110 |
ResponseUtil.sendErrorXML(response, ResponseUtil.NO_READ_PERMISSION, errorString);
|
|
112 | 111 |
return; |
113 | 112 |
} |
114 | 113 |
} catch (McdbException mcdbe) { |
... | ... | |
151 | 150 |
} catch (UtilException ue) { |
152 | 151 |
String errorString = "Utility error reading archive entry for docid: " |
153 | 152 |
+ docid + " : " + ue.getMessage(); |
154 |
ErrorUtil.sendError(response, ErrorUtil.GENERAL_UTILITY_ERROR, errorString);
|
|
153 |
ResponseUtil.sendErrorXML(response, ResponseUtil.GENERAL_UTILITY_ERROR, errorString);
|
|
155 | 154 |
throw new ErrorHandledException(null); |
156 | 155 |
} catch (PropertyNotFoundException pnfe) { |
157 | 156 |
String errorString = "Property error reading archive entry for docid: " |
158 | 157 |
+ docid + " : " + pnfe.getMessage(); |
159 |
ErrorUtil.sendError(response, ErrorUtil.PROPERTY_NOT_FOUND, errorString);
|
|
158 |
ResponseUtil.sendErrorXML(response, ResponseUtil.PROPERTY_NOT_FOUND, errorString);
|
|
160 | 159 |
throw new ErrorHandledException(null); |
161 | 160 |
} catch (MetacatUtilException mue) { |
162 | 161 |
String errorString = "Metacat utility error reading archive entry for docid: " |
163 | 162 |
+ docid + " : " + mue.getMessage(); |
164 |
ErrorUtil.sendError(response, ErrorUtil.METACAT_UTILITY_ERROR, errorString);
|
|
163 |
ResponseUtil.sendErrorXML(response, ResponseUtil.METACAT_UTILITY_ERROR, errorString);
|
|
165 | 164 |
throw new ErrorHandledException(null); |
166 | 165 |
} |
167 | 166 |
} |
Also available in: Unified diff
Added generic scheduler and workflow scheduling functionality.