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.ClassLoader
classLoader
private java.lang.String
resourceBase
-
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 int
classify(java.lang.Throwable error)
Classifies the type of exception that has been thrown from a previous request to the transporter.private java.net.URL
getResource(TransportTask task)
protected void
implClose()
ImplementsAbstractTransporter.close()
, gets only called if the transporter has not already been closed.protected void
implGet(GetTask task)
ImplementsAbstractTransporter.get(GetTask)
, gets only called if the transporter has not been closed.protected void
implPeek(PeekTask task)
ImplementsAbstractTransporter.peek(PeekTask)
, gets only called if the transporter has not been closed.protected void
implPut(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:Transporter
Classifies 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_FOUND
orTransporter.ERROR_OTHER
.
-
implPeek
protected void implPeek(PeekTask task) throws java.lang.Exception
Description copied from class:AbstractTransporter
ImplementsAbstractTransporter.peek(PeekTask)
, gets only called if the transporter has not been closed.- Specified by:
implPeek
in 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:AbstractTransporter
ImplementsAbstractTransporter.get(GetTask)
, gets only called if the transporter has not been closed.- Specified by:
implGet
in 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:AbstractTransporter
ImplementsAbstractTransporter.put(PutTask)
, gets only called if the transporter has not been closed.- Specified by:
implPut
in 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:AbstractTransporter
ImplementsAbstractTransporter.close()
, gets only called if the transporter has not already been closed.- Specified by:
implClose
in classAbstractTransporter
-
-