Skip to content

Commit

Permalink
Merge upstream 'master' branch from 'iipc/webarchive-commons'
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastian-nagel committed Dec 13, 2024
2 parents 3628dda + 90d28d7 commit e10c525
Show file tree
Hide file tree
Showing 15 changed files with 73 additions and 278 deletions.
229 changes: 0 additions & 229 deletions pom-cdh4.xml

This file was deleted.

24 changes: 0 additions & 24 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -135,30 +135,6 @@
<artifactId>libidn</artifactId>
<version>1.15</version>
</dependency>
<dependency>
<groupId>it.unimi.dsi</groupId>
<artifactId>dsiutils</artifactId>
<version>2.7.3</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
<!-- exclude the vulnerable commons-collections v3.2.1 -->
<exclusion>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- explicitly require a patched commons-collections to avoid vulnerable v3.2.1 -->
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.2</version>
</dependency>

<dependency>
<groupId>org.apache.httpcomponents</groupId>
Expand Down
42 changes: 42 additions & 0 deletions src/main/java/it/unimi/dsi/fastutil/io/RepositionableStream.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// copied from fastutil, keeping the original package name to avoid breaking
// compatibility with existing user code that implements this interface
package it.unimi.dsi.fastutil.io;

/*
* Copyright (C) 2005-2015 Sebastiano Vigna
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/


/** A basic interface specifying positioning methods for a byte stream.
*
* @author Sebastiano Vigna
* @since 4.4
*/

public interface RepositionableStream {

/** Sets the current stream position.
*
* @param newPosition the new stream position.
*/
void position( long newPosition ) throws java.io.IOException;

/** Returns the current stream position.
*
* @return the current stream position.
*/
long position() throws java.io.IOException;

}
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@
*
* @author stack
* @version $Revision$, $Date$
* @deprecated Commons HttpClient 3 is end of life, this will be removed in webarchive-commons 2.0
*/
@Deprecated
public class HttpRecorderGetMethod extends GetMethod {

protected static Logger logger =
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/archive/httpclient/HttpRecorderMethod.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
*
* @author stack
* @version $Revision$, $Date$
* @deprecated Commons HttpClient 3 is end of life, this will be removed in webarchive-commons 2.0
*/
@Deprecated
public class HttpRecorderMethod {
protected static Logger logger =
Logger.getLogger(HttpRecorderMethod.class.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
*
* @author stack
* @version $Date$ $Revision$
* @deprecated Commons HttpClient 3 is end of life, this will be removed in webarchive-commons 2.0
*/
@Deprecated
public class HttpRecorderPostMethod extends PostMethod {
/**
* Instance of http recorder method.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
* with external mechanisms.
*
* @author gojomo
* @deprecated Commons HttpClient 3 is end of life, this will be removed in webarchive-commons 2.0
*/
@Deprecated
public class SingleHttpConnectionManager extends SimpleHttpConnectionManager {

public SingleHttpConnectionManager() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@
*
* <b>Java &gt;= 1.4 is recommended.</b>
*
* @author Christian Kohlschuetter
* @author Christian Kohlschuetter
* @deprecated Commons HttpClient 3 is end of life, this will be removed in webarchive-commons 2.0
*/
@Deprecated
public final class ThreadLocalHttpConnectionManager implements
HttpConnectionManager {

Expand Down
19 changes: 4 additions & 15 deletions src/main/java/org/archive/io/ObjectPlusFilesOutputStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@
*/
package org.archive.io;

import java.io.File;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.io.*;
import java.nio.file.Files;
import java.util.LinkedList;

import org.archive.util.FileUtils;
Expand Down Expand Up @@ -116,19 +114,10 @@ public void snapshotAppendOnlyFile(File file) throws IOException {
* @throws IOException
*/
private void hardlinkOrCopy(File file, File destination) throws IOException {
// For Linux/UNIX, try a hard link first.
Process link = Runtime.getRuntime().exec("ln "+file.getAbsolutePath()+" "+destination.getAbsolutePath());
// TODO NTFS also supports hard links; add appropriate try
try {
link.waitFor();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if(link.exitValue()!=0) {
// hard link failed
Files.createLink(destination.toPath(), file.toPath());
} catch (UnsupportedEncodingException e) {
FileUtils.copyFile(file,destination);
}
}

}
Loading

0 comments on commit e10c525

Please sign in to comment.