Examples of OdfFileEntry


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

            object.setAttributeNS(OdfDocumentNamespace.XLINK.getUri(), "xlink:href",
                hasPrefix ? (prefix + newObjPath) : newObjPath);
            continue;
          }
          // check if the current document contains the same path
          OdfFileEntry fileEntry = getPackage().getFileEntry(refObjPath);
          // note: if refObjPath is a directory, it must end with '/'
          if (fileEntry == null) {
            fileEntry = getPackage().getFileEntry(refObjPath + "/");
          }
          newObjPath = refObjPath;
View Full Code Here

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

          if (refObjPath.startsWith(prefix)) {
            refObjPath = refObjPath.substring(2);
            hasPrefix = true;
          }
          // check if the current document contains the same path
          OdfFileEntry fileEntry = getPackage().getFileEntry(refObjPath);
          // note: if refObjPath is a directory, it must end with '/'
          if (fileEntry == null) {
            fileEntry = getPackage().getFileEntry(refObjPath + "/");
          }
          String newObjPath = refObjPath;
View Full Code Here

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

            // delete "./"
            if (refObjPath.startsWith("./")) {
              refObjPath = refObjPath.substring(2);
            }
            // check if the current document contains the same path
            OdfFileEntry fileEntry = getPackage().getFileEntry(refObjPath);
            if (fileEntry != null) {
              // it is a stream, such as image, binary file
              getPackage().remove(refObjPath);
            } else {
              // note: if refObjPath is a directory, it must end
View Full Code Here

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

    }
    return aLogger.hasError();
  }

  private boolean isEncrypted(String aEntryName, Logger aLogger) {
    OdfFileEntry aFileEntry = getPackage(aLogger).getFileEntry(aEntryName);
    if (aFileEntry != null) {
      EncryptionData aEncData = aFileEntry.getEncryptionData();
      if (aEncData != null) {
        aLogger.logFatalError("stream content is encrypted. Validataion of encrypted content is not supported.");
        return true;
      }
    }
View Full Code Here

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

        }
      }
      path = OdfPackage.normalizePath(path);
      _currentFileEntry = entries.get(path);
      if (_currentFileEntry == null) {
        _currentFileEntry = new OdfFileEntry();
      }
      if (path != null) {
        entries.put(path, _currentFileEntry);
      }
      _currentFileEntry.setPath(atts.getValue("manifest:full-path"));
View Full Code Here

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

      int embDocsNumber = embDocs.size();
      // the document "Object 1/
      OdfDocument embDoc = embDocs.get("Object 1/");
      String pathOfSecondInnerDoc = "Object in Object1/";
      embDoc.insertDocument(OdfTextDocument.newTextDocument(), pathOfSecondInnerDoc);
      OdfFileEntry fileEntry = embDoc.getPackage().getFileEntry(embDoc.getDocumentPath() + pathOfSecondInnerDoc);
      Assert.assertNotNull(fileEntry);

      // get "Object 1/content.xml"
      OdfContentDom contentDom = embDoc.getContentDom();
      XPath xpath = contentDom.getXPath();
View Full Code Here

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

    }
  }

  /** @returns the media type of the root document from the manifest.xml */
  private String getMediaTypeFromManifest() {
    OdfFileEntry rootDocumentEntry = mManifestEntries.get(SLASH);
    if (rootDocumentEntry != null) {
      return rootDocumentEntry.getMediaTypeString();
    } else {
      return null;
    }
  }
View Full Code Here

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

    }
    return mediaType;
  }

  private String getMediaTypeFromEntry(String internalPath) {
    OdfFileEntry entry = getFileEntry(internalPath);
    // if the document is not in the package, the return is NULL
    if (entry != null) {
      return entry.getMediaTypeString();
    } else {
      return null;
    }
  }
View Full Code Here

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

   *             - if the package could not be saved
   */
  private void save(OutputStream odfStream, String baseURL) {
    try {
      mBaseURI = baseURL;
      OdfFileEntry rootEntry = mManifestEntries.get(SLASH);
      if (rootEntry == null) {
        rootEntry = new OdfFileEntry(SLASH, mMediaType);
        mManifestEntries.put(SLASH, rootEntry);
      } else {
        rootEntry.setMediaTypeString(mMediaType);
      }
      ZipOutputStream zos = new ZipOutputStream(odfStream);

      // remove mediatype path and use it as first
      this.mManifestEntries.remove(OdfFile.MEDIA_TYPE.getPath());
View Full Code Here

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

      while (tok.hasMoreTokens()) {
        String directory = tok.nextToken();
        // it is a directory, if there are more token
        if (tok.hasMoreTokens()) {
          path = path + directory + SLASH;
          OdfFileEntry fileEntry = mManifestEntries.get(path);
          if (fileEntry == null) {
            mManifestEntries.put(path, new OdfFileEntry(path, null));
          }
        }
      }
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.