Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Rainer Villido authored and Rainer Villido committed Aug 3, 2015
2 parents 4220aad + e3d5d2b commit ec2c4bd
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .classpath
Expand Up @@ -5,13 +5,13 @@
<classpathentry kind="src" path="test"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.apache.ivyde.eclipse.cpcontainer.IVYDE_CONTAINER/?project=digidoc4j_development_codeborne&amp;ivyXmlPath=ivy.xml&amp;confs=*"/>
<classpathentry kind="lib" path="lib/dss-common-4.3.0-RC.jar"/>
<classpathentry kind="lib" path="lib/dss-document-4.3.0-RC.jar" sourcepath="/dss-document"/>
<classpathentry kind="lib" path="lib/dss-service-4.3.0-RC.jar"/>
<classpathentry kind="lib" path="lib/dss-spi-4.3.0-RC.jar"/>
<classpathentry kind="lib" path="lib/dss-common-4.4.RC2.jar"/>
<classpathentry kind="lib" path="lib/dss-document-4.4.RC2.jar" sourcepath="/dss-document"/>
<classpathentry kind="lib" path="lib/dss-service-4.4.RC2.jar"/>
<classpathentry kind="lib" path="lib/dss-spi-4.4.RC2.jar"/>
<classpathentry kind="lib" path="lib/jacocoagent.jar"/>
<classpathentry kind="lib" path="lib/jacocoant.jar"/>
<classpathentry kind="lib" path="lib/jdigidoc-3.10.1424.BETA.jar"/>
<classpathentry kind="lib" path="lib/jdigidoc-3.10.0-777.jar"/>
<classpathentry kind="lib" path="lib/testcerts.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
12 changes: 12 additions & 0 deletions src/org/digidoc4j/Container.java
Expand Up @@ -328,6 +328,12 @@ public enum SignatureProfile {
* @return data file
*/
public abstract DataFile getDataFile(int index);

/**
* Return the count of DataFile objects
* @return count of DataFile objects
*/
public abstract int countDataFiles();

/**
* Removes a data file from the container by data file name. Any corresponding signatures will be deleted.
Expand Down Expand Up @@ -388,6 +394,12 @@ public enum SignatureProfile {
* @return signature
*/
public abstract Signature getSignature(int index);

/**
* Return the count of Signature objects
* @return count of Signature objects
*/
public abstract int countSignatures();

/**
* Returns document type ASiC or DDOC
Expand Down
10 changes: 10 additions & 0 deletions src/org/digidoc4j/impl/BDocContainer.java
Expand Up @@ -522,6 +522,11 @@ public DataFile getDataFile(int index) {
logger.debug("get data file with index: " + index);
return getDataFiles().get(index);
}

@Override
public int countDataFiles() {
return (dataFiles == null) ? 0 : dataFiles.size();
}

@Override
public void removeDataFile(String fileName) {
Expand Down Expand Up @@ -841,6 +846,11 @@ public Signature getSignature(int index) {
logger.debug("Get signature for index " + index);
return getSignatures().get(index);
}

@Override
public int countSignatures() {
return (signatures == null) ? 0 : signatures.size();
}

@Override
public DocumentType getDocumentType() {
Expand Down
16 changes: 16 additions & 0 deletions src/org/digidoc4j/impl/DDocContainer.java
Expand Up @@ -306,6 +306,14 @@ public DataFile getDataFile(int index) {
return getDataFiles().get(index);
}

@Override
public int countDataFiles() {
logger.debug("Get the number of data files");
List<DataFile> dataFiles = getDataFiles();

return (dataFiles == null) ? 0 : dataFiles.size();
}

@Override
public void removeDataFile(String fileName) {
logger.debug("File name: " + fileName);
Expand Down Expand Up @@ -422,6 +430,14 @@ public Signature getSignature(int index) {
return getSignatures().get(index);
}

@Override
public int countSignatures() {
logger.debug("Get the number of signatures");
List<Signature> signatures = getSignatures();

return (signatures == null) ? 0 : signatures.size();
}

private Signature mapJDigiDocSignatureToDigiDoc4J(ee.sk.digidoc.Signature signature) {
logger.debug("");
Signature finalSignature = new DDocSignature(signature);
Expand Down

0 comments on commit ec2c4bd

Please sign in to comment.