Package org.odftoolkit.odfdom.pkg.manifest

Examples of org.odftoolkit.odfdom.pkg.manifest.FileEntryElement


      // Our assumption: it is a document if it has a mimetype...
      String dirMimeType = mManifestEntries.get(path).getMediaTypeString();
      if (dirMimeType == null || EMPTY_STRING.equals(dirMimeType)) {
        logValidationWarning(OdfPackageConstraint.MANIFEST_LISTS_DIRECTORY, getBaseURI(), path);
        OdfFileEntry manifestEntry = mManifestEntries.remove(path);
        FileEntryElement manifestEle = manifestEntry.getOdfElement();
        manifestEle.getParentNode().removeChild(manifestEle);
      }
    }
  }
View Full Code Here


        // size value.
        ze.setCompressedSize(data.length);
      } else {
        if (fileEntry != null) {
          fileEntry.setSize(null);
          FileEntryElement fileEntryEle = fileEntry.getOdfElement();
          EncryptionDataElement encryptionDataElement = OdfElement.findFirstChildNode(EncryptionDataElement.class, fileEntryEle);
          while (encryptionDataElement != null) {
            fileEntryEle.removeChild(encryptionDataElement);
            encryptionDataElement = OdfElement.findFirstChildNode(EncryptionDataElement.class, fileEntryEle);
          }
        }
        ze.setCompressedSize(-1);
      }
View Full Code Here

      setManifestVersion(manifestEle.getVersionAttribute());
    } else {
      logValidationError(OdfPackageConstraint.MANIFEST_NOT_IN_PACKAGE, getBaseURI());
    }
    Map<String, OdfFileEntry> entries = getManifestEntries();
    FileEntryElement fileEntryEle = OdfElement.findFirstChildNode(FileEntryElement.class, manifestEle);
    while (fileEntryEle != null) {
      String path = fileEntryEle.getFullPathAttribute();
      if (path.equals(EMPTY_STRING)) {
        if (getErrorHandler() != null) {
          logValidationError(OdfPackageConstraint.MANIFEST_WITH_EMPTY_PATH, getBaseURI());
        }
      }
View Full Code Here

      cipher.init(Cipher.ENCRYPT_MODE, key, ivParameterSpec);
      encryptedData = cipher.doFinal(compressedData, 0, compressedDataLength);
     
      // 9.update file entry encryption data.
      String checksum = new Base64Binary(checksumBytes).toString();
      FileEntryElement fileEntryElement = fileEntry.getOdfElement();
      EncryptionDataElement encryptionDataElement = OdfElement.findFirstChildNode(EncryptionDataElement.class, fileEntryElement);
      if (encryptionDataElement != null) {
        fileEntryElement.removeChild(encryptionDataElement);
      }
      encryptionDataElement = fileEntryElement.newEncryptionDataElement(checksum, "SHA1/1K");
      String initialisationVector = new Base64Binary(iv).toString();
      AlgorithmElement algorithmElement = OdfElement.findFirstChildNode(AlgorithmElement.class, encryptionDataElement);
      if (algorithmElement != null) {
        encryptionDataElement.removeChild(algorithmElement);
      }
View Full Code Here

    if (mZipEntries != null && mZipEntries.containsKey(internalPath)) {
      mZipEntries.remove(internalPath);
    }
    if (mManifestEntries != null && mManifestEntries.containsKey(internalPath)) {
      OdfFileEntry manifestEntry = mManifestEntries.remove(internalPath);
      FileEntryElement manifestEle = manifestEntry.getOdfElement();
      manifestEle.getParentNode().removeChild(manifestEle);
    }
  }
View Full Code Here

TOP

Related Classes of org.odftoolkit.odfdom.pkg.manifest.FileEntryElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.