Package org.mifosplatform.infrastructure.documentmanagement.exception

Examples of org.mifosplatform.infrastructure.documentmanagement.exception.ContentManagementException


         * Using Content-Length gives me size of the entire request, which is
         * good enough for now for a fast fail as the length of the rest of the
         * content i.e name and description while compared to the uploaded file
         * size is negligible
         **/
        if (fileSize != null && ((fileSize / (1024 * 1024)) > ContentRepository.MAX_FILE_UPLOAD_SIZE_IN_MB)) { throw new ContentManagementException(
                name, fileSize, ContentRepository.MAX_FILE_UPLOAD_SIZE_IN_MB); }
    }
View Full Code Here


    @Override
    public void deleteFile(final String documentName, final String documentPath) {
        try {
            deleteObjectFromS3(documentPath);
        } catch (final AmazonClientException ace) {
            throw new ContentManagementException(documentName, ace.getMessage());
        }
    }
View Full Code Here

        try {
            logger.info("Uploading a new object to S3 from a file to " + s3UploadLocation);
            this.s3Client.putObject(new PutObjectRequest(this.s3BucketName, s3UploadLocation, inputStream, new ObjectMetadata()));
        } catch (final AmazonClientException ace) {
            final String message = ace.getMessage();
            throw new ContentManagementException(filename, message);
        }
    }
View Full Code Here

            logger.error(dve.getMessage(), dve);
            throw new PlatformDataIntegrityException("error.msg.document.unknown.data.integrity.issue",
                    "Unknown data integrity issue with resource.");
        } catch (final ContentManagementException cme) {
            logger.error(cme.getMessage(), cme);
            throw new ContentManagementException(documentCommand.getName(), cme.getMessage());
        }
    }
View Full Code Here

            final byte[] imgBytes = Base64.decode(base64EncodedImage.getBase64EncodedString());
            out.write(imgBytes);
            out.flush();
            out.close();
        } catch (final IOException ioe) {
            throw new ContentManagementException(imageName, ioe.getMessage());
        }
        return fileLocation;
    }
View Full Code Here

    }

    @Override
    public void deleteFile(final String fileName, final String documentPath) {
        final boolean fileDeleted = deleteFile(documentPath);
        if (!fileDeleted) { throw new ContentManagementException(fileName, null); }
    }
View Full Code Here

                out.write(bytes, 0, read);
            }
            out.flush();
            out.close();
        } catch (final IOException ioException) {
            throw new ContentManagementException(fileName, ioException.getMessage());
        }
    }
View Full Code Here

TOP

Related Classes of org.mifosplatform.infrastructure.documentmanagement.exception.ContentManagementException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.