Class ClasspathTransporter
- java.lang.Object
-
- org.eclipse.aether.spi.connector.transport.AbstractTransporter
-
- org.eclipse.aether.transport.classpath.ClasspathTransporter
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,Transporter
final class ClasspathTransporter extends AbstractTransporter
A transporter reading from the classpath.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.ClassLoaderclassLoaderprivate java.lang.StringresourceBase-
Fields inherited from interface org.eclipse.aether.spi.connector.transport.Transporter
ERROR_NOT_FOUND, ERROR_OTHER
-
-
Constructor Summary
Constructors Constructor Description ClasspathTransporter(RepositorySystemSession session, RemoteRepository repository)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intclassify(java.lang.Throwable error)Classifies the type of exception that has been thrown from a previous request to the transporter.private java.net.URLgetResource(TransportTask task)protected voidimplClose()ImplementsAbstractTransporter.close(), gets only called if the transporter has not already been closed.protected voidimplGet(GetTask task)ImplementsAbstractTransporter.get(GetTask), gets only called if the transporter has not been closed.protected voidimplPeek(PeekTask task)ImplementsAbstractTransporter.peek(PeekTask), gets only called if the transporter has not been closed.protected voidimplPut(PutTask task)ImplementsAbstractTransporter.put(PutTask), gets only called if the transporter has not been closed.
-
-
-
Constructor Detail
-
ClasspathTransporter
ClasspathTransporter(RepositorySystemSession session, RemoteRepository repository) throws NoTransporterException
- Throws:
NoTransporterException
-
-
Method Detail
-
getResource
private java.net.URL getResource(TransportTask task) throws java.lang.Exception
- Throws:
java.lang.Exception
-
classify
public int classify(java.lang.Throwable error)
Description copied from interface:TransporterClassifies the type of exception that has been thrown from a previous request to the transporter. The exception types employed by a transporter are generally unknown to its caller. Where a caller needs to distinguish between certain error cases, it employs this method to detect which error case corresponds to the exception.- Parameters:
error- The exception to classify, must not benull.- Returns:
- The classification of the error, either
Transporter.ERROR_NOT_FOUNDorTransporter.ERROR_OTHER.
-
implPeek
protected void implPeek(PeekTask task) throws java.lang.Exception
Description copied from class:AbstractTransporterImplementsAbstractTransporter.peek(PeekTask), gets only called if the transporter has not been closed.- Specified by:
implPeekin classAbstractTransporter- Parameters:
task- The existence check to perform, must not benull.- Throws:
java.lang.Exception- If the existence of the specified resource could not be confirmed.
-
implGet
protected void implGet(GetTask task) throws java.lang.Exception
Description copied from class:AbstractTransporterImplementsAbstractTransporter.get(GetTask), gets only called if the transporter has not been closed.- Specified by:
implGetin classAbstractTransporter- Parameters:
task- The download to perform, must not benull.- Throws:
java.lang.Exception- If the transfer failed.
-
implPut
protected void implPut(PutTask task) throws java.lang.Exception
Description copied from class:AbstractTransporterImplementsAbstractTransporter.put(PutTask), gets only called if the transporter has not been closed.- Specified by:
implPutin classAbstractTransporter- Parameters:
task- The upload to perform, must not benull.- Throws:
java.lang.Exception- If the transfer failed.
-
implClose
protected void implClose()
Description copied from class:AbstractTransporterImplementsAbstractTransporter.close(), gets only called if the transporter has not already been closed.- Specified by:
implClosein classAbstractTransporter
-
-