public final class ReqIFArchive
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
extension |
| Modifier and Type | Method and Description |
|---|---|
ReqIFFile |
addExistingReqIFFile(java.lang.String reqIFPath,
java.util.function.Consumer<ValidationMessage> validationMessageConsumer)
Adds to this archive a new ReqIFFile object loaded from the existing ReqIF file identified by the specified full path
|
ReqIFFile |
createReqIFFile(java.lang.String filename,
java.lang.String comment,
java.util.Date creationTime,
java.lang.String repositoryId,
java.lang.String reqIFToolId,
java.lang.String sourceToolId,
java.lang.String title,
java.lang.String reqIFIdentifier)
Constructs a new empty named ReqIF file and adds it to the archive.
|
java.util.List<java.lang.String> |
getArchiveFileRelativePaths()
Returns the
List<String> of relative paths obtained from all 'data' attributes in XHTML <object> elements |
Identifiable<?> |
getIdentifiable(java.lang.String identifier)
Returns the
Identifiable object according to the specified identifier |
java.lang.String |
getPath()
Returns the path of this archive if the archive was loaded or saved from disk.
|
ReqIFFiles |
getReqIFFiles()
Gets the collection of
ReqIFFile objects inside this archive. |
java.nio.file.Path |
getTempDirPath() |
void |
removeReqIFFile(ReqIFFile reqIFFileToRemove)
Removes the specified ReqIFFile from the archive
|
void |
save(java.util.function.Consumer<ValidationMessage> validationMessageConsumer)
Saves this archive in the current archive path as established when the archive was loaded, if it was loaded
Otherwise established in the last call to
saveAs. |
void |
saveAs(java.lang.String targetPath,
java.util.function.Consumer<ValidationMessage> validationMessageConsumer)
Saves this archive in the specified path
|
public static final java.lang.String extension
public java.util.List<java.lang.String> getArchiveFileRelativePaths()
List<String> of relative paths obtained from all 'data' attributes in XHTML <object> elementsList<String> of relative paths obtained from all 'data' attributes in XHTML <object> elementspublic java.lang.String getPath()
If the archive was created not loaded/saved, this methods returns the temporary location
public ReqIFFile createReqIFFile(java.lang.String filename, java.lang.String comment, java.util.Date creationTime, java.lang.String repositoryId, java.lang.String reqIFToolId, java.lang.String sourceToolId, java.lang.String title, java.lang.String reqIFIdentifier) throws AlreadyExistsException, FileException, InvalidValueException, InvalidIdentifierException
filename - the name of the ReqIF file, not nullcomment - the value to be assigned to the COMMENT header element, can be nullcreationTime - the value to be assigned to the CREATION-DATE header element, can be null to auto-assign 'now'repositoryId - the value to be assigned to the REPOSITORY-ID header element, can be nullreqIFToolId - the value to be assigned to the REQ-IF-TOOL-ID header element, not nullsourceToolId - the value to be assigned to the SOURCE-TOOL-ID header element, not nulltitle - the value to be assigned to the TITLE header element, not nullreqIFIdentifier - the value to be assigned to the @IDENTIFIER header attribute, not null and uniqueReqIFFile object, not nullAlreadyExistsException - if the ReqIF file identified by the filename parameter has already been added to the archiveFileException - if an exception occurs during creation of the ReqIF fileInvalidValueException - if a required parameter is null or emptyInvalidIdentifierException - if the reqIFIdentifier parameter is not a valid xsd:IDpublic ReqIFFiles getReqIFFiles()
ReqIFFile objects inside this archive.ReqIFFiles collection, not nullpublic void removeReqIFFile(ReqIFFile reqIFFileToRemove) throws NotFoundException
reqIFFileToRemove - ReqIFFile object to removeItem from the archiveNotFoundException - Specified ReqIFFile object is not in this archivepublic Identifiable<?> getIdentifiable(java.lang.String identifier)
Identifiable object according to the specified identifieridentifier - the String identifier of the Identifiable to search, not nullIdentifiable object with the specified identifier or nullpublic ReqIFFile addExistingReqIFFile(java.lang.String reqIFPath, java.util.function.Consumer<ValidationMessage> validationMessageConsumer) throws NotFoundException, AlreadyExistsException, FileException, ValidationException, java.io.IOException
reqIFPath - the full path to the ReqIF file to add to this archivevalidationMessageConsumer - a consumer of validation message objects ValidationMessage, not nullReqIFFile object loaded from the specified file, not nullNotFoundException - if the file at the specified path does not existAlreadyExistsException - if the specified path already represented in the archiveFileException - if the file at the specified path is not a valid ReqIFValidationException - if ReqIF validation errors have occurredjava.io.IOException - if the ReqIF file could not be copied into the archive temp folderpublic java.nio.file.Path getTempDirPath()
public void save(java.util.function.Consumer<ValidationMessage> validationMessageConsumer) throws FileException, NotSavedException
saveAs.validationMessageConsumer - the Consumer to receive validation messages, not nullFileException - if a file system exception occurs when savingNotSavedException - if the path has not already been established in a previous call to saveAspublic void saveAs(java.lang.String targetPath,
java.util.function.Consumer<ValidationMessage> validationMessageConsumer)
throws FileException
targetPath - the path for the ReqIF archivevalidationMessageConsumer - the Consumer to receive validation messages, not nullFileException - if a file system exception occurs when saving