Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/maven-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
with:
servers: |
[{
"id": "sonatype-nexus-snapshots",
"id": "central-portal-snapshots",
"username": "${{ secrets.SONATYPE_BOT_USERNAME }}",
"password": "${{ secrets.SONATYPE_BOT_TOKEN }}"
}]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import java.io.InputStream;
import java.io.OutputStream;

import static org.apache.commons.lang.StringUtils.join;
import static org.apache.commons.lang3.StringUtils.join;

public class Transfer
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package org.commonjava.maven.galley.util;

import static org.apache.commons.lang.StringUtils.isEmpty;
import static org.apache.commons.lang3.StringUtils.isEmpty;
import static org.commonjava.maven.galley.util.LocationUtils.ATTR_PATH_ENCODE;
import static org.commonjava.maven.galley.util.LocationUtils.PATH_ENCODE_BASE64;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import org.commonjava.maven.galley.spi.event.FileEventManager;
import org.commonjava.maven.galley.spi.io.PathGenerator;
import org.commonjava.maven.galley.util.PathUtils;
import org.commonjava.util.partyline.JoinableFileManager;
import org.commonjava.util.partyline.Partyline;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -55,7 +55,7 @@ public class PartyLineCacheProvider

private final Logger logger = LoggerFactory.getLogger( getClass() );

private final JoinableFileManager fileManager;
private final Partyline fileManager;

private final PartyLineCacheProviderConfig config;

Expand All @@ -70,7 +70,7 @@ public class PartyLineCacheProvider
public PartyLineCacheProvider( final File cacheBasedir, final PathGenerator pathGenerator,
final FileEventManager fileEventManager, final TransferDecoratorManager transferDecorator,
final ScheduledExecutorService deleteExecutor,
final JoinableFileManager fileManager)
final Partyline fileManager)
{
this.pathGenerator = pathGenerator;
this.fileEventManager = fileEventManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import org.commonjava.maven.galley.spi.cache.CacheProvider;
import org.commonjava.maven.galley.spi.event.FileEventManager;
import org.commonjava.maven.galley.spi.io.PathGenerator;
import org.commonjava.util.partyline.JoinableFileManager;
import org.commonjava.util.partyline.Partyline;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -61,7 +61,7 @@ public synchronized CacheProvider create( PathGenerator pathGenerator, TransferD
{
if ( provider == null )
{
JoinableFileManager fileManager = new JoinableFileManager();
Partyline fileManager = new Partyline();
provider = new PartyLineCacheProvider( cacheDir, pathGenerator, fileEventManager, transferDecorator,
deleteExecutor, fileManager );
provider.getConfig().withTimeoutProcessingEnabled( timeoutProcessing );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import org.commonjava.maven.galley.spi.event.FileEventManager;
import org.commonjava.maven.galley.spi.io.PathGenerator;
import org.commonjava.maven.galley.spi.io.TransferDecorator;
import org.commonjava.util.partyline.JoinableFileManager;
import org.commonjava.util.partyline.Partyline;
import org.jboss.byteman.contrib.bmunit.BMScript;
import org.jboss.byteman.contrib.bmunit.BMUnitConfig;
import org.junit.Before;
Expand Down Expand Up @@ -81,7 +81,7 @@ public void setup()
throws Exception
{
provider = new PartyLineCacheProvider( temp.newFolder(), pathgen, events, new TransferDecoratorManager( decorator ),
Executors.newScheduledThreadPool( 2 ), new JoinableFileManager() );
Executors.newScheduledThreadPool( 2 ), new Partyline() );
latch = new CountDownLatch( 2 );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.commonjava.maven.galley.spi.event.FileEventManager;
import org.commonjava.maven.galley.spi.io.PathGenerator;
import org.commonjava.maven.galley.spi.io.TransferDecorator;
import org.commonjava.util.partyline.JoinableFileManager;
import org.commonjava.util.partyline.Partyline;
import org.junit.Before;
import org.junit.Rule;
import org.junit.rules.TemporaryFolder;
Expand All @@ -49,7 +49,7 @@ public void setup()
final TransferDecorator decorator = new TestTransferDecorator();

provider = new PartyLineCacheProvider( temp.newFolder(), pathgen, events, new TransferDecoratorManager( decorator ),
Executors.newScheduledThreadPool( 2 ), new JoinableFileManager() );
Executors.newScheduledThreadPool( 2 ), new Partyline() );
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import java.util.HashSet;
import java.util.Set;

import static org.apache.commons.lang.StringUtils.join;
import static org.apache.commons.lang3.StringUtils.join;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;

Expand Down Expand Up @@ -122,8 +122,8 @@ public void writeAndListDirectory()
out.flush();
out.close();

// NOTE: This is NOT as tightly specified as I would like.
// We keep the listing assertions loose (greater-than instead of equals,
// NOTE: This is NOT as tightly specified as I would like.
// We keep the listing assertions loose (greater-than instead of equals,
// contains instead of exact positional assertion) because the Infinispan
// live testing has these spurious foo.txt.#0 files cropping up.
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
import org.commonjava.o11yphant.trace.SpanFieldsDecorator;
import org.commonjava.o11yphant.trace.TraceManager;
import org.commonjava.o11yphant.trace.TracerConfiguration;
import org.commonjava.util.partyline.JoinableFileManager;
import org.commonjava.util.partyline.Partyline;
import org.junit.Assert;
import org.junit.rules.TemporaryFolder;

Expand Down Expand Up @@ -155,7 +155,7 @@ public void start()
temp.create();
cacheProvider =
new PartyLineCacheProvider( temp.newFolder(), pathGenerator, eventManager, transferDecorator,
Executors.newScheduledThreadPool( 2 ), new JoinableFileManager() );
Executors.newScheduledThreadPool( 2 ), new Partyline() );
fileTransportConfig = new FileTransportConfig( temp.newFolder(), pathGenerator );
}
catch ( IOException e )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
import static java.lang.Boolean.TRUE;
import static org.apache.commons.io.IOUtils.closeQuietly;
import static org.apache.commons.io.IOUtils.copy;
import static org.apache.commons.lang.StringUtils.join;
import static org.apache.commons.lang3.StringUtils.join;
import static org.commonjava.maven.galley.model.Transfer.DELETE_CONTENT_LOG;
import static org.commonjava.maven.galley.util.LocationUtils.getTimeoutSeconds;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import static org.apache.commons.lang.StringUtils.join;
import static org.apache.commons.lang3.StringUtils.join;
import static org.commonjava.maven.galley.io.SpecialPathConstants.MVN_SP_PATH_SET;
import static org.commonjava.maven.galley.io.SpecialPathConstants.NPM_SP_PATH_SET;
import static org.commonjava.maven.galley.io.SpecialPathConstants.PKG_TYPE_MAVEN;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@
import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
import static org.apache.commons.io.IOUtils.closeQuietly;
import static org.apache.commons.lang.StringUtils.isEmpty;
import static org.apache.commons.lang.StringUtils.join;
import static org.apache.commons.lang3.StringUtils.isEmpty;
import static org.apache.commons.lang3.StringUtils.join;

import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package org.commonjava.maven.galley.maven.parse;

import static org.apache.commons.io.IOUtils.closeQuietly;
import static org.apache.commons.lang.StringUtils.isEmpty;
import static org.apache.commons.lang3.StringUtils.isEmpty;

import java.io.File;
import java.io.FileInputStream;
Expand Down
73 changes: 14 additions & 59 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.commonjava</groupId>
<artifactId>commonjava</artifactId>
<version>18</version>
<version>21</version>
</parent>

<groupId>org.commonjava.maven.galley</groupId>
Expand Down Expand Up @@ -50,24 +50,24 @@

<projectOwner>Red Hat, Inc.</projectOwner>
<projectEmail>https://github.com/Commonjava/galley</projectEmail>
<atlasVersion>1.1.3</atlasVersion>
<partylineVersion>1.16</partylineVersion>
<pathmappedStorageVersion>2.5</pathmappedStorageVersion>
<weftVersion>1.24</weftVersion>
<jhttpcVersion>1.15</jhttpcVersion>
<infinispanVersion>9.4.7.Final</infinispanVersion>
<atlasVersion>1.1.8</atlasVersion>
<partylineVersion>2.2</partylineVersion>
<pathmappedStorageVersion>3.1</pathmappedStorageVersion>
<weftVersion>1.25</weftVersion>
<jhttpcVersion>1.16</jhttpcVersion>
<!-- Match the version currently being used by other CommonJava components -->
<infinispanVersion>9.4.24.Final</infinispanVersion>
<weldVersion>3.1.9.Final</weldVersion>
<byteman.version>4.0.20</byteman.version>
<o11yphantVersion>1.9.1</o11yphantVersion>
<byteman.version>4.0.26</byteman.version>
<o11yphantVersion>1.9.2</o11yphantVersion>
<!-- Cannot upgrade to 4.3.1.0 as it causes NoClassDefFoundError com/datastax/oss/driver/api/core/config/DriverOption -->
<cassandraUnitVersion>3.7.1.0</cassandraUnitVersion>
<hibernateVersion>5.4.33.Final</hibernateVersion>
<h2Version>2.2.220</h2Version>
<activationVersion>1.2.0</activationVersion>
<annotationVersion>1.3.2</annotationVersion>
<test-forkCount>1</test-forkCount>
<test-redirectOutput>true</test-redirectOutput>
<jacksonVersion>2.15.2</jacksonVersion>
<logbackVersion>1.4.14</logbackVersion>

<plugin.jacoco.skip>false</plugin.jacoco.skip>
</properties>
Expand Down Expand Up @@ -179,28 +179,18 @@
<dependency>
<groupId>org.commonjava.boms</groupId>
<artifactId>web-commons-bom</artifactId>
<version>29</version>
<version>31</version>
<scope>import</scope>
<type>pom</type>
</dependency>

<dependency>
<groupId>org.commonjava.util</groupId>
<artifactId>http-testserver</artifactId>
<version>1.3</version>
<version>1.5.3</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.7</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.15</version>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
Expand Down Expand Up @@ -242,7 +232,7 @@
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.15.3</version>
<version>1.21.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
Expand All @@ -265,11 +255,6 @@
<artifactId>infinispan-commons</artifactId>
<version>${infinispanVersion}</version>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
<version>3.4.3.Final</version>
</dependency>

<!-- Used to simulate remote repositories in transport/httpclient -->
<dependency>
Expand Down Expand Up @@ -347,29 +332,10 @@
<artifactId>javax.annotation-api</artifactId>
<version>${annotationVersion}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jacksonVersion}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jacksonVersion}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jacksonVersion}</version>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand All @@ -388,16 +354,6 @@
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logbackVersion}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>${logbackVersion}</version>
</dependency>
</dependencies>

<modules>
Expand All @@ -424,7 +380,6 @@
<configuration>
<source>${javaVersion}</source>
<target>${javaVersion}</target>
<release>${javaVersion}</release>
</configuration>
</plugin>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public DownloadJob createDownloadJob( final ConcreteResource resource, final Tra
{
return new HttpDownload( getUrl( resource ), getHttpLocation( resource.getLocation(), download ), target,
transferSizes, eventMetadata, http, mapper, metricRegistry, metricConfig,
globalProxyConfig.getEgressSites(), proxySitesCache );
globalProxyConfig == null ? null : globalProxyConfig.getEgressSites(), proxySitesCache );
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If an HttpClientTransport was manually created the globalProxyConfig might be null so this needs a null check. Found this when testing the updated version against PME.

}

@Override
Expand Down Expand Up @@ -165,7 +165,8 @@ public ListingJob createListingJob( final ConcreteResource resource, final Trans
{
return new HttpListing( getUrl( resource ),
new ConcreteResource( getHttpLocation( resource.getLocation(), listing ),
resource.getPath() ), http, globalProxyConfig.getEgressSites(),
resource.getPath() ), http,
globalProxyConfig == null ? null : globalProxyConfig.getEgressSites(),
proxySitesCache );
}

Expand All @@ -190,7 +191,7 @@ public ExistenceJob createExistenceJob( final ConcreteResource resource, final T
throws TransferException
{
return new HttpExistence( getUrl( resource ), getHttpLocation( resource.getLocation(), existence ), target,
http, mapper, globalProxyConfig.getEgressSites(), proxySitesCache );
http, mapper, globalProxyConfig == null ? null : globalProxyConfig.getEgressSites(), proxySitesCache );
}

private String getUrl( final ConcreteResource resource )
Expand Down