/** * Throws an exception (of any kind) if the specified part name does not * follow the Open Packaging Convention specifications naming rules. * * @param partUri * The part name to check. * @throws Exception * Throws if the part name is invalid. */ private static void throwExceptionIfInvalidPartUri(URI partUri) throws InvalidFormatException { if (partUri == null) throw new IllegalArgumentException("partUri"); // Check if the part name URI is empty [M1.1] throwExceptionIfEmptyURI(partUri); // Check if the part name URI is absolute throwExceptionIfAbsoluteUri(partUri); // Check if the part name URI doesn't start with a forward slash [M1.4] throwExceptionIfPartNameNotStartsWithForwardSlashChar(partUri); // Check if the part name URI ends with a forward slash [M1.5] throwExceptionIfPartNameEndsWithForwardSlashChar(partUri); // Check if the part name does not have empty segments. [M1.3] // Check if a segment ends with a dot ('.') character. [M1.9] throwExceptionIfPartNameHaveInvalidSegments(partUri); }
/** * Throws an exception (of any kind) if the specified part name does not * follow the Open Packaging Convention specifications naming rules. * * @param partUri * The part name to check. * @throws Exception * Throws if the part name is invalid. */ private static void throwExceptionIfInvalidPartUri(URI partUri) throws InvalidFormatException { if (partUri == null) throw new IllegalArgumentException("partUri"); // Check if the part name URI is empty [M1.1] throwExceptionIfEmptyURI(partUri); // Check if the part name URI is absolute throwExceptionIfAbsoluteUri(partUri); // Check if the part name URI doesn't start with a forward slash [M1.4] throwExceptionIfPartNameNotStartsWithForwardSlashChar(partUri); // Check if the part name URI ends with a forward slash [M1.5] throwExceptionIfPartNameEndsWithForwardSlashChar(partUri); // Check if the part name does not have empty segments. [M1.3] // Check if a segment ends with a dot ('.') character. [M1.9] throwExceptionIfPartNameHaveInvalidSegments(partUri); }