Package de.schlichtherle.truezip.zip

Examples of de.schlichtherle.truezip.zip.ZipEntry


        Enumeration<? extends ZipEntry> en = getZipFile().entries();

        while ( en.hasMoreElements() )
        {
            final ZipEntry e = en.nextElement();

            final String name = e.getName();

            if ( filter != null && !filter.accepts( name ) )
            {
                continue;
            }
View Full Code Here


    }

    public InputStream getEntryContent( String path )
        throws IOException
    {
        ZipEntry entry = getZipFile().getEntry( path );

        if ( entry != null )
        {
            return getZipFile().getInputStream( entry );
        }
View Full Code Here

   *
   * @throws java.io.IOException
   */
  private void saveVersion(ZipOutputStream zipStream) throws IOException {

    zipStream.putNextEntry(new ZipEntry(VERSION_FILENAME));

    String MZmineVersion = MZmineCore.getMZmineVersion();

    zipStream.write(MZmineVersion.getBytes());

View Full Code Here

    logger.info("Saving configuration file");

    currentSavedObjectName = "configuration";

    zipStream.putNextEntry(new ZipEntry(CONFIG_FILENAME));
    File tempConfigFile = File.createTempFile("mzmineconfig", ".tmp");

    try {
      MZmineCore.getConfiguration().saveConfiguration(tempConfigFile);
    } catch (Exception e) {
View Full Code Here

      logger.info("Saving peak list: " + peakLists[i].getName());

      String peakListSavedName = "Peak list #" + (i + 1) + " "
          + peakLists[i].getName();

      zipStream.putNextEntry(new ZipEntry(peakListSavedName + ".xml"));

      peakListSaveHandler = new PeakListSaveHandler(zipStream,
          dataFilesIDMap);

      currentSavedObjectName = peakLists[i].getName();
View Full Code Here

    if (isCanceled())
      return;

    logger.info("Saving user parameters");

    zipStream.putNextEntry(new ZipEntry("User parameters.xml"));

    userParameterSaveHandler = new UserParameterSaveHandler(zipStream,
        savedProject, dataFilesIDMap);

    currentSavedObjectName = "User parameters";
View Full Code Here

      OutputStream finalStream = fos;

      if (compression) {
        ZipOutputStream zos = new ZipOutputStream(fos);
        zos.setLevel(9);
        zos.putNextEntry(new ZipEntry(fileName.getName()));
        finalStream = zos;
      }

      Hashtable<RawDataFile, String> dataFilesIDMap = new Hashtable<RawDataFile, String>();
      for (RawDataFile file : peakList.getRawDataFiles()) {
View Full Code Here

    logger.info("Saving data points of: " + rawDataFile.getName());

    String rawDataSavedName = "Raw data file #" + number + " "
        + rawDataFile.getName();

    zipOutputStream.putNextEntry(new ZipEntry(rawDataSavedName + ".scans"));

    // We save only those data points that still have a reference in the
    // dataPointsOffset table. Some deleted mass lists may still be present
    // in the data points file, we don't want to copy those.
    long newOffset = 0;
    byte buffer[] = new byte[1 << 20];
    RandomAccessFile dataPointsFile = rawDataFile.getDataPointsFile();
    for (Integer storageID : dataPointsOffsets.keySet()) {

      if (canceled)
        return;

      final long offset = dataPointsOffsets.get(storageID);
      dataPointsFile.seek(offset);

      final int bytes = dataPointsLengths.get(storageID) * 4 * 2;
      consolidatedDataPointsOffsets.put(storageID, newOffset);
      if (buffer.length < bytes) {
        buffer = new byte[bytes * 2];
      }
      dataPointsFile.read(buffer, 0, bytes);
      zipOutputStream.write(buffer, 0, bytes);
      newOffset += bytes;
      progress = 0.9 * ((double) offset / dataPointsFile.length());
    }

    if (canceled)
      return;

    // step 2 - save raw data description
    logger.info("Saving raw data description of: " + rawDataFile.getName());

    zipOutputStream.putNextEntry(new ZipEntry(rawDataSavedName + ".xml"));
    OutputStream finalStream = zipOutputStream;

    StreamResult streamResult = new StreamResult(finalStream);
    SAXTransformerFactory tf = (SAXTransformerFactory) SAXTransformerFactory
        .newInstance();
View Full Code Here

   */
  private void loadVersion(ZipFile zipFile) throws IOException {

    logger.info("Checking project version");

    ZipEntry versionEntry = zipFile
        .getEntry(ProjectSavingTask.VERSION_FILENAME);

    if (versionEntry == null) {
      throw new IOException(
          "This file is not valid MZmine 2 project. It does not contain version information.");
View Full Code Here

   */
  private void loadConfiguration(ZipFile zipFile) throws IOException {

    logger.info("Loading configuration file");

    ZipEntry configEntry = zipFile
        .getEntry(ProjectSavingTask.CONFIG_FILENAME);

    if (configEntry == null) {
      throw new IOException(
          "This file is not valid MZmine 2 project. It does not contain configuration data.");
View Full Code Here

TOP

Related Classes of de.schlichtherle.truezip.zip.ZipEntry

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.