final class WagonTransporter extends java.lang.Object implements Transporter
Modifier and Type | Class and Description |
---|---|
private class |
WagonTransporter.GetTaskRunner |
private static class |
WagonTransporter.PeekTaskRunner |
private class |
WagonTransporter.PutTaskRunner |
private static interface |
WagonTransporter.TaskRunner |
Modifier and Type | Field and Description |
---|---|
private java.util.concurrent.atomic.AtomicBoolean |
closed |
private static java.lang.String |
CONFIG_PROP_CONFIG |
private static java.lang.String |
CONFIG_PROP_DIR_MODE |
private static java.lang.String |
CONFIG_PROP_FILE_MODE |
private static java.lang.String |
CONFIG_PROP_GROUP |
private java.util.Properties |
headers |
private static org.slf4j.Logger |
LOGGER |
private AuthenticationContext |
proxyAuthContext |
private AuthenticationContext |
repoAuthContext |
private RemoteRepository |
repository |
private RepositorySystemSession |
session |
private org.apache.maven.wagon.authentication.AuthenticationInfo |
wagonAuth |
private WagonConfigurator |
wagonConfigurator |
private java.lang.String |
wagonHint |
private WagonProvider |
wagonProvider |
private org.apache.maven.wagon.proxy.ProxyInfoProvider |
wagonProxy |
private org.apache.maven.wagon.repository.Repository |
wagonRepo |
private java.util.Queue<org.apache.maven.wagon.Wagon> |
wagons |
ERROR_NOT_FOUND, ERROR_OTHER
Constructor and Description |
---|
WagonTransporter(WagonProvider wagonProvider,
WagonConfigurator wagonConfigurator,
RemoteRepository repository,
RepositorySystemSession session) |
Modifier and Type | Method and Description |
---|---|
int |
classify(java.lang.Throwable error)
Classifies the type of exception that has been thrown from a previous request to the transporter.
|
void |
close()
Closes this transporter and frees any network resources associated with it.
|
private void |
connectWagon(org.apache.maven.wagon.Wagon wagon) |
private static void |
copy(java.io.OutputStream os,
java.io.InputStream is) |
private void |
delTempFile(java.io.File path) |
private void |
disconnectWagon(org.apache.maven.wagon.Wagon wagon) |
private void |
execute(TransportTask task,
WagonTransporter.TaskRunner runner) |
void |
get(GetTask task)
Downloads a resource from the repository.
|
private org.apache.maven.wagon.authentication.AuthenticationInfo |
getAuthenticationInfo(AuthenticationContext authContext) |
private static org.apache.maven.wagon.repository.RepositoryPermissions |
getPermissions(java.lang.String repoId,
RepositorySystemSession session) |
private org.apache.maven.wagon.proxy.ProxyInfoProvider |
getProxy(RemoteRepository repository,
AuthenticationContext authContext) |
private org.apache.maven.wagon.Wagon |
lookupWagon() |
private static java.io.File |
newTempFile() |
void |
peek(PeekTask task)
Checks the existence of a resource in the repository.
|
private org.apache.maven.wagon.Wagon |
pollWagon() |
void |
put(PutTask task)
Uploads a resource to the repository.
|
private void |
releaseWagon(org.apache.maven.wagon.Wagon wagon) |
private static final java.lang.String CONFIG_PROP_CONFIG
private static final java.lang.String CONFIG_PROP_FILE_MODE
private static final java.lang.String CONFIG_PROP_DIR_MODE
private static final java.lang.String CONFIG_PROP_GROUP
private static final org.slf4j.Logger LOGGER
private final RemoteRepository repository
private final RepositorySystemSession session
private final AuthenticationContext repoAuthContext
private final AuthenticationContext proxyAuthContext
private final WagonProvider wagonProvider
private final WagonConfigurator wagonConfigurator
private final java.lang.String wagonHint
private final org.apache.maven.wagon.repository.Repository wagonRepo
private final org.apache.maven.wagon.authentication.AuthenticationInfo wagonAuth
private final org.apache.maven.wagon.proxy.ProxyInfoProvider wagonProxy
private final java.util.Properties headers
private final java.util.Queue<org.apache.maven.wagon.Wagon> wagons
private final java.util.concurrent.atomic.AtomicBoolean closed
WagonTransporter(WagonProvider wagonProvider, WagonConfigurator wagonConfigurator, RemoteRepository repository, RepositorySystemSession session) throws NoTransporterException
NoTransporterException
private static org.apache.maven.wagon.repository.RepositoryPermissions getPermissions(java.lang.String repoId, RepositorySystemSession session)
private org.apache.maven.wagon.authentication.AuthenticationInfo getAuthenticationInfo(AuthenticationContext authContext)
private org.apache.maven.wagon.proxy.ProxyInfoProvider getProxy(RemoteRepository repository, AuthenticationContext authContext)
private org.apache.maven.wagon.Wagon lookupWagon() throws java.lang.Exception
java.lang.Exception
private void releaseWagon(org.apache.maven.wagon.Wagon wagon)
private void connectWagon(org.apache.maven.wagon.Wagon wagon) throws org.apache.maven.wagon.WagonException
org.apache.maven.wagon.WagonException
private void disconnectWagon(org.apache.maven.wagon.Wagon wagon)
private org.apache.maven.wagon.Wagon pollWagon() throws java.lang.Exception
java.lang.Exception
public int classify(java.lang.Throwable error)
Transporter
classify
in interface Transporter
error
- The exception to classify, must not be null
.Transporter.ERROR_NOT_FOUND
or Transporter.ERROR_OTHER
.public void peek(PeekTask task) throws java.lang.Exception
Transporter
Transporter.classify(Throwable)
with that exception yields Transporter.ERROR_NOT_FOUND
.peek
in interface Transporter
task
- The existence check to perform, must not be null
.java.lang.Exception
- If the existence of the specified resource could not be confirmed.public void get(GetTask task) throws java.lang.Exception
Transporter
GetTask.getDataFile()
and the operation fails midway, the transporter should not delete the partial file
but leave its management to the caller.get
in interface Transporter
task
- The download to perform, must not be null
.java.lang.Exception
- If the transfer failed.public void put(PutTask task) throws java.lang.Exception
Transporter
put
in interface Transporter
task
- The upload to perform, must not be null
.java.lang.Exception
- If the transfer failed.private void execute(TransportTask task, WagonTransporter.TaskRunner runner) throws java.lang.Exception
java.lang.Exception
private static java.io.File newTempFile() throws java.io.IOException
java.io.IOException
private void delTempFile(java.io.File path)
private static void copy(java.io.OutputStream os, java.io.InputStream is) throws java.io.IOException
java.io.IOException
public void close()
Transporter
IllegalStateException
or similar.
Closing an already closed transporter is harmless and has no effect.close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in interface Transporter