public boolean handleAuditEntryError(Long entryId, String errorMsg, Throwable error) { throw new CmisRuntimeException("Audit entry " + entryId + ": " + errorMsg, error); } };
public boolean handleAuditEntryError(Long entryId, String errorMsg, Throwable error) { throw new CmisRuntimeException("Audit entry " + entryId + ": " + errorMsg, error); } };
public static Document newDomDocument() { throw new CmisRuntimeException("This method should never be used on Android!"); } }
public String getPayload() { try { return baous.toString(IOUtils.UTF8); } catch (UnsupportedEncodingException e) { throw new CmisRuntimeException("Unsupported encoding 'UTF-8'!", e); } } }
protected MutablePolicyTypeDefinition createPolicyTypeDefinitionObject() { try { return policyTypeDefinitionClass.newInstance(); } catch (Exception e) { throw new CmisRuntimeException("Cannot create type defintion object: " + e.getMessage(), e); } }
protected MutableSecondaryTypeDefinition createSecondaryTypeDefinitionObject() { try { return secondaryTypeDefinitionClass.newInstance(); } catch (Exception e) { throw new CmisRuntimeException("Cannot create type defintion object: " + e.getMessage(), e); } }
public WrapperDefinition(Class<? extends AbstractCmisServiceWrapper> wrapperClass, Object... params) { this.wrapperClass = wrapperClass; this.params = params; if (wrapperClass == null) { throw new CmisRuntimeException("Wrapper class must be set!"); } try { wrapperConstructor = wrapperClass.getConstructor(CONSTRUCTOR_PARAMETERS); } catch (Exception e) { throw new CmisRuntimeException("Could not access constructor of service wrapper " + wrapperClass.getName() + ": " + e.toString(), e); } }
protected MutableDocumentTypeDefinition createDocumentTypeDefinitionObject() { try { return documentTypeDefinitionClass.newInstance(); } catch (Exception e) { throw new CmisRuntimeException("Cannot create type defintion object: " + e.getMessage(), e); } }
protected MutableRelationshipTypeDefinition createRelationshipTypeDefinitionObject() { try { return relationshipTypeDefinitionClass.newInstance(); } catch (Exception e) { throw new CmisRuntimeException("Cannot create type defintion object: " + e.getMessage(), e); } }
protected MutableItemTypeDefinition createItemTypeDefinitionObject() { try { return itemTypeDefinitionClass.newInstance(); } catch (Exception e) { throw new CmisRuntimeException("Cannot create type defintion object: " + e.getMessage(), e); } }
protected MutableFolderTypeDefinition createFolderTypeDefinitionObject() { try { return folderTypeDefinitionClass.newInstance(); } catch (Exception e) { throw new CmisRuntimeException("Cannot create type defintion object: " + e.getMessage(), e); } }
@SuppressWarnings("unchecked") public static Map<String, Object> getMap(final Object o) { if (o == null) { return null; } if (o instanceof Map) { return (Map<String, Object>) o; } throw new CmisRuntimeException("Expected a JSON object but found a " + (o instanceof List ? "JSON array" : o.getClass().getSimpleName()) + ": " + o.toString()); }
@SuppressWarnings("unchecked") public static List<Object> getList(final Object o) { if (o == null) { return null; } if (o instanceof List) { return (List<Object>) o; } throw new CmisRuntimeException("Expected a JSON array but found a " + (o instanceof List ? "JSON object" : o.getClass().getSimpleName()) + ": " + o.toString()); }
@SuppressWarnings("unchecked") public static Map<String, Object> getMap(final Object o) { if (o == null) { return null; } if (o instanceof Map) { return (Map<String, Object>) o; } throw new CmisRuntimeException("Expected a JSON object but found a " + (o instanceof List ? "JSON array" : o.getClass().getSimpleName()) + ": " + o.toString()); }
@SuppressWarnings("unchecked") public static List<Object> getList(final Object o) { if (o == null) { return null; } if (o instanceof List) { return (List<Object>) o; } throw new CmisRuntimeException("Expected a JSON array but found a " + (o instanceof List ? "JSON object" : o.getClass().getSimpleName()) + ": " + o.toString()); }
protected static BigInteger getBigIntegerParameter(Map<String, String> parameters, String key, int def) { String value = parameters.get(key); try { return StringUtils.isBlank(value) ? BigInteger.valueOf(def) : new BigInteger(value); } catch (NumberFormatException e) { throw new CmisRuntimeException("Could not parse configuration values for " + key + ": " + e.getMessage(), e); } }
private static List<Boolean> copyBooleanValues(List<Object> source) { List<Boolean> result = null; if (source != null) { result = new ArrayList<Boolean>(source.size()); for (Object obj : source) { if (obj instanceof Boolean) { result.add((Boolean) obj); } else { throw new CmisRuntimeException("Invalid property value: " + obj); } } } return result; }
private static List<BigInteger> copyIntegerValues(List<Object> source) { List<BigInteger> result = null; if (source != null) { result = new ArrayList<BigInteger>(source.size()); for (Object obj : source) { if (obj instanceof BigInteger) { result.add((BigInteger) obj); } else { throw new CmisRuntimeException("Invalid property value: " + obj); } } } return result; }
private static List<BigInteger> copyIntegerValues(List<Object> source) { List<BigInteger> result = null; if (source != null) { result = new ArrayList<BigInteger>(source.size()); for (Object obj : source) { if (obj instanceof BigInteger) { result.add((BigInteger) obj); } else { throw new CmisRuntimeException("Invalid property value: " + obj); } } } return result; }
protected static long getLongParameter(Map<String, String> parameters, String key, long def) { String value = parameters.get(key); try { return StringUtils.isBlank(value) ? def : Long.parseLong(value); } catch (NumberFormatException e) { throw new CmisRuntimeException("Could not parse configuration values for " + key + ": " + e.getMessage(), e); } }