private void checkPageDisplayNameIsValid(final String displayName) throws SInvalidPageZipMissingPropertiesException, SInvalidPageZipMissingAPropertyException { if (displayName == null || displayName.length() == 0) { throw new SInvalidPageZipMissingAPropertyException(PageService.PROPERTIES_DISPLAY_NAME); } }
private InvalidPageZipContentException convertException(final SInvalidPageZipException e) { if (e instanceof SInvalidPageZipMissingPropertiesException) { return new InvalidPageZipMissingPropertiesException(); } if (e instanceof SInvalidPageZipMissingAPropertyException) { return new InvalidPageZipMissingAPropertyException(((SInvalidPageZipMissingAPropertyException) e).getFields()); } if (e instanceof SInvalidPageZipInconsistentException) { return new InvalidPageZipInconsistentException(e.getMessage(), e); } if (e instanceof SInvalidPageZipMissingIndexException) { return new InvalidPageZipMissingIndexException(); } return new InvalidPageZipContentException(e.getMessage(), e); }
private InvalidPageZipContentException convertException(final SInvalidPageZipException e) { if (e instanceof SInvalidPageZipMissingPropertiesException) { return new InvalidPageZipMissingPropertiesException(); } if (e instanceof SInvalidPageZipMissingAPropertyException) { return new InvalidPageZipMissingAPropertyException(((SInvalidPageZipMissingAPropertyException) e).getFields()); } if (e instanceof SInvalidPageZipInconsistentException) { return new InvalidPageZipInconsistentException(e.getMessage(), e); } if (e instanceof SInvalidPageZipMissingIndexException) { return new InvalidPageZipMissingIndexException(); } return new InvalidPageZipContentException(e.getMessage(), e); }
private void checkPageDisplayNameIsValid(final String displayName) throws SInvalidPageZipMissingPropertiesException, SInvalidPageZipMissingAPropertyException { if (displayName == null || displayName.length() == 0) { throw new SInvalidPageZipMissingAPropertyException(PageService.PROPERTIES_DISPLAY_NAME); } }
public Properties getPageProperties(final byte[] content, final boolean checkIfItAlreadyExists) throws InvalidPageTokenException, AlreadyExistsException, InvalidPageZipMissingPropertiesException, InvalidPageZipMissingIndexException, InvalidPageZipInconsistentException, InvalidPageZipMissingAPropertyException { try { return getProperties(content, checkIfItAlreadyExists, pageService); } catch (final SInvalidPageTokenException e) { throw new InvalidPageTokenException(e.getMessage()); } catch (final SBonitaReadException e) { throw new RetrieveException(e); } catch (final SInvalidPageZipMissingAPropertyException e) { throw new InvalidPageZipMissingAPropertyException(e.getFields()); } catch (final SInvalidPageZipInconsistentException e) { throw new InvalidPageZipInconsistentException(e.getMessage(), e); } catch (final SInvalidPageZipMissingIndexException e) { throw new InvalidPageZipMissingIndexException(); } catch (final SInvalidPageZipMissingPropertiesException e) { throw new InvalidPageZipMissingPropertiesException(); } }
private void checkApiControllerExists(Map<String, byte[]> zipContent, Properties pageProperties) throws SInvalidPageZipInconsistentException, SInvalidPageZipMissingAPropertyException { final Set<String> entrySet = zipContent.keySet(); final String declaredApis = pageProperties.getProperty(API_EXTENSIONS); if (declaredApis == null || declaredApis.isEmpty()) { throw new SInvalidPageZipMissingAPropertyException(API_EXTENSIONS); } final String[] apis = declaredApis.split(","); for (final String api : apis) { final String classFileName = pageProperties.getProperty(api.trim() + "." + CLASS_FILENAME); if (classFileName == null || classFileName.isEmpty()) { throw new SInvalidPageZipMissingAPropertyException(api.trim() + "." + CLASS_FILENAME); } if (!entrySet.contains(classFileName.trim())) { throw new SInvalidPageZipInconsistentException(String.format("RestAPIController %s has not been found in archive.", classFileName.trim())); } } }
public Properties getPageProperties(final byte[] content, final boolean checkIfItAlreadyExists) throws InvalidPageTokenException, AlreadyExistsException, InvalidPageZipMissingPropertiesException, InvalidPageZipMissingIndexException, InvalidPageZipInconsistentException, InvalidPageZipMissingAPropertyException { try { return getProperties(content, checkIfItAlreadyExists, pageService); } catch (final SInvalidPageTokenException e) { throw new InvalidPageTokenException(e.getMessage()); } catch (final SBonitaReadException e) { throw new RetrieveException(e); } catch (final SInvalidPageZipMissingAPropertyException e) { throw new InvalidPageZipMissingAPropertyException(e.getFields()); } catch (final SInvalidPageZipInconsistentException e) { throw new InvalidPageZipInconsistentException(e.getMessage(), e); } catch (final SInvalidPageZipMissingIndexException e) { throw new InvalidPageZipMissingIndexException(); } catch (final SInvalidPageZipMissingPropertiesException e) { throw new InvalidPageZipMissingPropertiesException(); } }
private void checkApiControllerExists(Map<String, byte[]> zipContent, Properties pageProperties) throws SInvalidPageZipInconsistentException, SInvalidPageZipMissingAPropertyException { final Set<String> entrySet = zipContent.keySet(); final String declaredApis = pageProperties.getProperty(API_EXTENSIONS); if (declaredApis == null || declaredApis.isEmpty()) { throw new SInvalidPageZipMissingAPropertyException(API_EXTENSIONS); } final String[] apis = declaredApis.split(","); for (final String api : apis) { final String classFileName = pageProperties.getProperty(api.trim() + "." + CLASS_FILENAME); if (classFileName == null || classFileName.isEmpty()) { throw new SInvalidPageZipMissingAPropertyException(api.trim() + "." + CLASS_FILENAME); } if (!entrySet.contains(classFileName.trim())) { throw new SInvalidPageZipInconsistentException(String.format("RestAPIController %s has not been found in archive.", classFileName.trim())); } } }