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.protected String
getValidDataPackageFilename
(String dataPackageFilename, ASiCContent asicContent) This method returns a valid data package filenameprotected 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
This method is used to append a "META-INF/" string to the filename, when required. -
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
-