|
|
@@ -67,7 +67,7 @@ public class RepositoryManagementServiceImpl implements RepositoryManagementServ
|
|
|
|
|
|
private ReloadableResourceBundleMessageSource messageSource;
|
|
|
|
|
|
- private String attachmentsPath = specialProperties.getLocalBaseDir() + "/tmp/jasperserver/axis_attachments";
|
|
|
+ // private String attachmentsPath;
|
|
|
|
|
|
private Logger logger = LoggerFactory.getLogger(getClass());
|
|
|
|
|
|
@@ -78,6 +78,8 @@ public class RepositoryManagementServiceImpl implements RepositoryManagementServ
|
|
|
messageSource.setUseCodeAsDefaultMessage(true);
|
|
|
messageSource.setFallbackToSystemLocale(false);
|
|
|
messageSource.setBasenames("bundlePathsListCe");
|
|
|
+ // attachmentsPath = specialProperties.getLocalBaseDir() +
|
|
|
+ // "/tmp/jasperserver/axis_attachments";
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -362,46 +364,50 @@ public class RepositoryManagementServiceImpl implements RepositoryManagementServ
|
|
|
|
|
|
/**
|
|
|
* Function to get attachments from an Axis message
|
|
|
- * @throws WSException
|
|
|
- * @throws NoSuchMessageException
|
|
|
- * @throws AxisFault
|
|
|
+ *
|
|
|
+ * @throws WSException
|
|
|
+ * @throws NoSuchMessageException
|
|
|
+ * @throws AxisFault
|
|
|
*
|
|
|
*/
|
|
|
- public AttachmentPart[] getMessageAttachments() throws NoSuchMessageException, WSException, AxisFault {
|
|
|
- try {
|
|
|
- MessageContext msgContext = MessageContext.getCurrentContext();
|
|
|
- File file = new File(attachmentsPath);
|
|
|
- if (!file.exists()) {
|
|
|
- file.mkdirs();
|
|
|
- }
|
|
|
- msgContext.setProperty(MessageContext.ATTACHMENTS_DIR, attachmentsPath);
|
|
|
- Message reqMsg = msgContext.getRequestMessage();
|
|
|
- Attachments messageAttachments = reqMsg.getAttachmentsImpl();
|
|
|
- if (null == messageAttachments) {
|
|
|
- logger.error("no attachment support");
|
|
|
- return new AttachmentPart[0];
|
|
|
- }
|
|
|
- int attachmentCount = messageAttachments.getAttachmentCount();
|
|
|
- AttachmentPart attachments[] = new AttachmentPart[attachmentCount];
|
|
|
-
|
|
|
- Iterator<?> it = messageAttachments.getAttachments().iterator();
|
|
|
- int count = 0;
|
|
|
- while (it.hasNext()) {
|
|
|
- AttachmentPart part = (AttachmentPart) it.next();
|
|
|
- attachments[count++] = part;
|
|
|
- }
|
|
|
- return attachments;
|
|
|
- } catch (AxisFault e) {
|
|
|
- if (e.getFaultString().startsWith("java.io.IOException")) {
|
|
|
-// throw new JSExceptionWrapper(new WSException(WSException.GENERAL_ERROR,
|
|
|
-// messageSource.getMessage("webservices.error.attachments.folder", null, getLocale())));
|
|
|
- throw new WSException(WSException.GENERAL_ERROR,
|
|
|
- messageSource.getMessage("webservices.error.attachments.folder", null, getLocale()));
|
|
|
- }
|
|
|
-// throw new JSExceptionWrapper(e);
|
|
|
- throw e;
|
|
|
- }
|
|
|
- }
|
|
|
+ // public AttachmentPart[] getMessageAttachments() throws
|
|
|
+ // NoSuchMessageException, WSException, AxisFault {
|
|
|
+ // try {
|
|
|
+ // MessageContext msgContext = MessageContext.getCurrentContext();
|
|
|
+ // File file = new File(attachmentsPath);
|
|
|
+ // if (!file.exists()) {
|
|
|
+ // file.mkdirs();
|
|
|
+ // }
|
|
|
+ // msgContext.setProperty(MessageContext.ATTACHMENTS_DIR, attachmentsPath);
|
|
|
+ // Message reqMsg = msgContext.getRequestMessage();
|
|
|
+ // Attachments messageAttachments = reqMsg.getAttachmentsImpl();
|
|
|
+ // if (null == messageAttachments) {
|
|
|
+ // logger.error("no attachment support");
|
|
|
+ // return new AttachmentPart[0];
|
|
|
+ // }
|
|
|
+ // int attachmentCount = messageAttachments.getAttachmentCount();
|
|
|
+ // AttachmentPart attachments[] = new AttachmentPart[attachmentCount];
|
|
|
+ //
|
|
|
+ // Iterator<?> it = messageAttachments.getAttachments().iterator();
|
|
|
+ // int count = 0;
|
|
|
+ // while (it.hasNext()) {
|
|
|
+ // AttachmentPart part = (AttachmentPart) it.next();
|
|
|
+ // attachments[count++] = part;
|
|
|
+ // }
|
|
|
+ // return attachments;
|
|
|
+ // } catch (AxisFault e) {
|
|
|
+ // if (e.getFaultString().startsWith("java.io.IOException")) {
|
|
|
+ //// throw new JSExceptionWrapper(new WSException(WSException.GENERAL_ERROR,
|
|
|
+ //// messageSource.getMessage("webservices.error.attachments.folder", null,
|
|
|
+ // getLocale())));
|
|
|
+ // throw new WSException(WSException.GENERAL_ERROR,
|
|
|
+ // messageSource.getMessage("webservices.error.attachments.folder", null,
|
|
|
+ // getLocale()));
|
|
|
+ // }
|
|
|
+ //// throw new JSExceptionWrapper(e);
|
|
|
+ // throw e;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
|
|
|
public Locale getLocale() {
|
|
|
return locale;
|