Package eu.europa.esig.dss.asic.common
Class AbstractASiCFilenameFactory
java.lang.Object
eu.europa.esig.dss.asic.common.AbstractASiCFilenameFactory
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
DefaultASiCWithCAdESFilenameFactory
,DefaultASiCWithXAdESFilenameFactory
This class contains common methods for ASiC filename factory.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
assertASiCContentIsValid
(ASiCContent asicContent) This method is used to verify whether the providedasicContent
contains all the required information for a new filename determinationprotected void
assertFilenameValid
(String filename, List<DSSDocument> documentsOfType) This method verifies whether the givenfilename
represents a valid document name within a containerprotected String
getNextAvailableDocumentName
(String nameTemplate, Collection<String> existingDocumentNames) This method returns the next available suffix (i.e. number) for a new file entry across given document names.protected String
getValidDataPackageFilename
(String dataPackageFilename, ASiCContent asicContent) This method returns a valid data package filenameprotected String
getValidEvidenceRecordManifestFilename
(String evidenceRecordManifestFilename, ASiCContent asicContent) This method returns a valid evidence record manifest filename.protected String
getWithMetaInfFolder
(String filename) This method is used to append a "META-INF/" string to the filename, when required.protected boolean
isAvailableName
(String filename, Collection<String> restrictedNames) This method verifies whether thefilename
is not present withinrestrictedNames
-
Constructor Details
-
AbstractASiCFilenameFactory
protected AbstractASiCFilenameFactory()Default constructor
-
-
Method Details
-
getNextAvailableDocumentName
protected String getNextAvailableDocumentName(String nameTemplate, Collection<String> existingDocumentNames) This method returns the next available suffix (i.e. number) for a new file entry across given document names. Ex.: For provided two signature documents, the method will return "003" suffix, to be used for a signature file creation with a name "META-INF/signature003.xml". -
isAvailableName
This method verifies whether thefilename
is not present withinrestrictedNames
-
getWithMetaInfFolder
-
assertASiCContentIsValid
This method is used to verify whether the providedasicContent
contains all the required information for a new filename determination- Parameters:
asicContent
-ASiCContent
to be verified
-
assertFilenameValid
This method verifies whether the givenfilename
represents a valid document name within a container- Parameters:
filename
-String
filename to checkdocumentsOfType
- list ofDSSDocument
of the same type as a creating document
-
getValidDataPackageFilename
This method returns a valid data package filename- Parameters:
dataPackageFilename
-String
defined data package filenameasicContent
-ASiCContent
- Returns:
String
data package filename
-
getValidEvidenceRecordManifestFilename
protected String getValidEvidenceRecordManifestFilename(String evidenceRecordManifestFilename, ASiCContent asicContent) This method returns a valid evidence record manifest filename. NOTE: The name of the file shall be: "META-INF/ASiCEvidenceRecordManifest*.xml". "META-INF/" is optional.- Parameters:
evidenceRecordManifestFilename
-String
defines evidence record manifest filenameasicContent
-ASiCContent
- Returns:
String
evidence record manifest filename
-