doArchive: Workhorse function to archive log-files.
@param logListURI : The uri which will serve list of log-files to archive.
@param archiveDirectory : The directory to store archived logfiles.
@throws IOException
347752
public void	
    doArchive(String logListURI, String archiveDirectory)
    throws IOException
  {
    String destURL = FileSystem.getDefaultUri(fsConfig) + archiveDirectory;
    DistCp.copy(new JobConf(fsConfig), logListURI, destURL, null, true, false);
  }
756836
private Archive openArchive(File zipFileName, boolean useOptimizedZip) throws IOException {
        File origZipFileName = zipFileName;
        if (symbolFileEnabled && locations.isDefaultBootClassPathRtJar(zipFileName)) {
            File file = zipFileName.getParentFile().getParentFile(); // ${java.home}
            if (new File(file.getName()).equals(new File("jre")))
                file = file.getParentFile();
            // file == ${jdk.home}
            for (String name : symbolFileLocation)
                file = new File(file, name);
            // file == ${jdk.home}/lib/ct.sym
            if (file.exists())
                zipFileName = file;
        }

        Archive archive;
        try {

            ZipFile zdir = null;

            boolean usePreindexedCache = false;
            String preindexCacheLocation = null;

            if (!useOptimizedZip) {
                zdir = new ZipFile(zipFileName);
            } else {
                usePreindexedCache = options.isSet("usezipindex");
                preindexCacheLocation = options.get("java.io.tmpdir");
                String optCacheLoc = options.get("cachezipindexdir");

                if (optCacheLoc != null && optCacheLoc.length() != 0) {
                    if (optCacheLoc.startsWith("\"")) {
                        if (optCacheLoc.endsWith("\"")) {
                            optCacheLoc = optCacheLoc.substring(1, optCacheLoc.length() - 1);
                        }
                        else {
                            optCacheLoc = optCacheLoc.substring(1);
                        }
                    }

                    File cacheDir = new File(optCacheLoc);
                    if (cacheDir.exists() && cacheDir.canWrite()) {
                        preindexCacheLocation = optCacheLoc;
                        if (!preindexCacheLocation.endsWith("/") &&
                            !preindexCacheLocation.endsWith(File.separator)) {
                            preindexCacheLocation += File.separator;
                        }
                    }
                }
            }

            if (origZipFileName == zipFileName) {
                if (!useOptimizedZip) {
                    archive = new ZipArchive(this, zdir);
                } else {
                    archive = new ZipFileIndexArchive(this,
                                    zipFileIndexCache.getZipFileIndex(zipFileName,
                                    null,
                                    usePreindexedCache,
                                    preindexCacheLocation,
                                    options.isSet("writezipindexfiles")));
                }
            } else {
                if (!useOptimizedZip) {
                    archive = new SymbolArchive(this, origZipFileName, zdir, symbolFilePrefix);
                } else {
                    archive = new ZipFileIndexArchive(this,
                                    zipFileIndexCache.getZipFileIndex(zipFileName,
                                    symbolFilePrefix,
                                    usePreindexedCache,
                                    preindexCacheLocation,
                                    options.isSet("writezipindexfiles")));
                }
            }
        } catch (FileNotFoundException ex) {
            archive = new MissingArchive(zipFileName);
        } catch (ZipFileIndex.ZipFormatException zfe) {
            throw zfe;
        } catch (IOException ex) {
            if (zipFileName.exists())
                log.error("error.reading.file", zipFileName, getMessage(ex));
            archive = new MissingArchive(zipFileName);
        }

        archives.put(origZipFileName, archive);
        return archive;
    }
357298
function FileVault(name, logger) {
	this.name = name;
	this.archive = new Archive(this);  // archivist bindings

	this.allowExpire = true;
	this.path = undefined;
	this.logger = logger;
	this._timers = {};
}
878285
def _get_and_write_archive(self, hunt, output_file_path):
    
    hunt_archive = hunt.GetFilesArchive()
    hunt_archive.WriteToFile(output_file_path)
15112
private void maybeRotateLog() throws IOException {
    if (!mRotateLogForNextWrite) {
      return;
    }
    if (mJournalOutputStream != null) {
      mJournalOutputStream.close();
      mJournalOutputStream = null;
    }

    createNewLogFile(mNextSequenceNumber);
    mRotateLogForNextWrite = false;
  }
873087
private void rolloverLogTask()
  {
    try {
      if (_isInit) {
        flush();
      }
    } catch (Exception e) {
      log.log(Level.WARNING, e.toString(), e);
    }

    _isRollingOver = true;
    
    try {
      if (! _isInit)
        return;
      
      Path savedPath = null;

      long now = CurrentTime.currentTime();

      long lastPeriodEnd = _nextPeriodEnd;

      _nextPeriodEnd = nextRolloverTime(now);

      Path path = getPath();

      synchronized (_logLock) {
        flushTempStream();

        long length = Files.size(path);
        
        if (lastPeriodEnd <= now && lastPeriodEnd > 0) {
          closeLogStream();

          savedPath = getSavedPath(lastPeriodEnd - 1);
        }
        else if (path != null && getRolloverSize() <= length) {
          closeLogStream();

          savedPath = getSavedPath(now);
        }
      }
      
      // archiving of path is outside of the synchronized block to
      // avoid freezing during archive
      if (savedPath != null) {
        movePathToArchive(savedPath);
      }
    } catch (IOException e) {
      e.printStackTrace();
    } finally {
      synchronized (_logLock) {
        _isRollingOver = false;
        flushTempStream();
      }
      
      _rolloverListener.requeue(_rolloverAlarm);
    }
  }
160190
def _archive(self):
        
        archive, archive_file = _retrieve_archive()

        if self.backup:
            self.backup.add_archive(archive)

        if archive:
            from topydo.commands.ArchiveCommand import ArchiveCommand
            command = ArchiveCommand(self.todolist, archive)
            command.execute()

            if archive.dirty:
                archive_file.write(archive.print_todos())
101295
def log(ctx, archive_name):
    '''
    
    '''

    _generate_api(ctx)
    ctx.obj.api.get_archive(archive_name).log()
1109339
private File createArchive() throws Exception {
        getLog().info("Creating archive.");
        Artifact artifact = mavenProject.getArtifact();
        String clsfr = noclassifier ? "" : ("-" + classifier);
        String archiveName = artifact.getArtifactId() + "-" + artifact.getVersion() + clsfr + ".jar";
        File jarFile = new File(mavenProject.getBuild().getDirectory(), archiveName);
        MavenArchiver archiver = new MavenArchiver();
        jarArchiver.addDirectory(stagingDirectory);
        archiver.setArchiver(jarArchiver);
        archiver.setOutputFile(jarFile);
        archiver.createArchive(mavenSession, mavenProject, archiveConfig);
        
        if (noclassifier) {
            artifact.setFile(jarFile);
        } else {
            projectHelper.attachArtifact(mavenProject, jarFile, classifier);
        }
        
        FileUtils.deleteDirectory(stagingDirectory);
        return jarFile;
    }
916985
private static List<File> getFileListing(File logDir) throws Exception {
        List<File> result = getFileListingLogs(logDir);
        return result;
    }
360965
public void setSourceArchiveUrls(List<String> sourceArchiveUrls) {
        if (sourceArchiveUrls == null)
            throw new IllegalArgumentException();
        this.sourceArchiveUrls = new ArrayList<String>(sourceArchiveUrls);
    }
1053116
public void setLogDataDirectory(String logDataDirectory) {
    	LogState state = ivLog.setDataDirectory(logDataDirectory);
    	if (state != null) {
    		updateLogConfiguration(state);
    		state.copyTo(ivLog);
    	}
    }
629887
protected void writeLogRecord(LogRecord logRecord)
    {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "writeLogRecord", logRecord);

        _activeFile.writeLogRecord(logRecord);

        if (tc.isEntryEnabled())
            Tr.exit(tc, "writeLogRecord");
    }
638784
protected void cleanUpArchiver( AbstractArchiver archiver )
    {
        try
        {
            Method cleanUpMethod = AbstractArchiver.class.getDeclaredMethod( "cleanUp" );
            cleanUpMethod.setAccessible( true );
            cleanUpMethod.invoke( archiver );
        }
        catch ( Exception e )
        {
            getLog().warn( "\"" + e.getMessage() + "\" exception while invoking AbstractArchiver.cleanUp() using reflection. Ignoring." );
        }
    }
1030819
protected List<File> getRecursiveThriftFiles(MavenProject project, String outputDirectory) throws IOException {
    return getRecursiveThriftFiles(project, outputDirectory, new ArrayList<File>());
  }
630251
@Override
	public void run()
	{

		try {
			ArchiveManager archives = new ArchiveManager();
			ArticleReaderInterface articleReader = null;
			ArchiveDescription description = null;
			Task<Revision> task = null;
			DiffCalculatorInterface diffCalc;

			if (MODE_STATISTICAL_OUTPUT) {
				diffCalc = new TimedDiffCalculator(new TaskTransmitter());
			}
			else {
				diffCalc = new DiffCalculator(new TaskTransmitter());
			}

			long start, time;

			while (archives.hasArchive()) {


				// Retrieve Archive
				try {
					description = archives.getArchive();

					// initialize filter
					ArticleFilter nameFilter = new ArticleFilter();

					articleReader = InputFactory.getTaskReader(description,
							nameFilter);
					ArticleConsumerLogMessages.logArchiveRetrieved(logger,
							description);

					// Exception while accessing the archive
				}
				catch (ArticleReaderException e) {

					articleReader = null;
					ArticleConsumerLogMessages.logExceptionRetrieveArchive(
							logger, description, e);
				}

				// Process Archive
				while (articleReader != null) {
					try {
						if (articleReader.hasNext()) {

							start = System.currentTimeMillis();
							//read the next article (may be null if filtered)
							task = articleReader.next();
							time = System.currentTimeMillis() - start;

							// task will be null if the name filter removed that
							// article
							if (task == null) {
								continue;
							}

							ArticleConsumerLogMessages
									.logArticleRead(logger, task, time,
											articleReader.getBytePosition());

							start = System.currentTimeMillis();
							//calculate the diff for this article version
							diffCalc.process(task);
							time = System.currentTimeMillis() - start;

							DiffConsumerLogMessages.logArticleProcessed(logger,
									task, time);

						}
						else {
							ArticleConsumerLogMessages.logNoMoreArticles(
									logger, description);
							articleReader = null;
						}

						// Reset current article
					}
					catch (ArticleReaderException e) {

						ArticleConsumerLogMessages.logTaskReaderException(
								logger, e);
						articleReader.resetTaskCompleted();

					}
					catch (DiffException e) {

						DiffConsumerLogMessages.logDiffException(logger, e);
						articleReader.resetTaskCompleted();
						diffCalc.reset();
					}
				}
			}
			diffCalc.closeTransmitter();

			ArticleConsumerLogMessages.logNoMoreArchives(logger);

			// Critical Exceptions
		}
		catch (ConfigurationException e) {
			DiffToolLogMessages.logException(logger, e);
			throw new RuntimeException(e);
		}
		catch (UnsupportedEncodingException e) {
			DiffToolLogMessages.logException(logger, e);
			throw new RuntimeException(e);
		}
		catch (IOException e) {
			DiffToolLogMessages.logException(logger, e);
			throw new RuntimeException(e);
		}
		catch (TimeoutException e) {
			DiffToolLogMessages.logException(logger, e);
			throw new RuntimeException(e);
		}
		catch (Exception e) {
			DiffToolLogMessages.logException(logger, e);
			throw new RuntimeException(e);
		}
	}
154277
@Override
    public T addAsLibraries(Archive<?>... archives) throws IllegalArgumentException {
        Validate.notNull(archives, "Archives must be specified");
        for (final Archive<?> archive : archives) {
            addAsLibrary(archive);
        }
        return covarientReturn();
    }