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 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,
Logger logger) |
| 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(RemoteRepository repository,
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 final 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, Logger logger) throws NoTransporterException
NoTransporterExceptionprivate static org.apache.maven.wagon.repository.RepositoryPermissions getPermissions(java.lang.String repoId,
RepositorySystemSession session)
private org.apache.maven.wagon.authentication.AuthenticationInfo getAuthenticationInfo(RemoteRepository repository, 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.Exceptionprivate void releaseWagon(org.apache.maven.wagon.Wagon wagon)
private void connectWagon(org.apache.maven.wagon.Wagon wagon)
throws java.lang.Exception
java.lang.Exceptionprivate void disconnectWagon(org.apache.maven.wagon.Wagon wagon)
private org.apache.maven.wagon.Wagon pollWagon()
throws java.lang.Exception
java.lang.Exceptionpublic int classify(java.lang.Throwable error)
Transporterclassify in interface Transportererror - 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
TransporterTransporter.classify(Throwable) with that exception yields Transporter.ERROR_NOT_FOUND.peek in interface Transportertask - 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
TransporterGetTask.getDataFile() and the operation fails midway, the transporter should not delete the partial file
but leave its management to the caller.get in interface Transportertask - The download to perform, must not be null.java.lang.Exception - If the transfer failed.public void put(PutTask task) throws java.lang.Exception
Transporterput in interface Transportertask - 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.Exceptionprivate static java.io.File newTempFile()
throws java.io.IOException
java.io.IOExceptionprivate void delTempFile(java.io.File path)
private static void copy(java.io.OutputStream os,
java.io.InputStream is)
throws java.io.IOException
java.io.IOExceptionpublic void close()
TransporterIllegalStateException or similar.
Closing an already closed transporter is harmless and has no effect.close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in interface Transporter