Package org.apache.maven.api.services
Interface Transport
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Implementing Classes:
DefaultTransport
Transport for specified remote repository (using provided remote repository base URI as root). Must be treated as a
resource, best in try-with-resource block.
- Since:
- 4.0
-
Method Summary
Modifier and TypeMethodDescriptionboolean
GETs the source URI content into target (does not have to exist, or will be overwritten if exist).Optional<byte[]>
GETs the source URI content as byte array.GETs the source URI content as string using UTF8 charset.GETs the source URI content as string.void
PUTs the source file (must exist as file) to target URI.void
PUTs the source byte array to target URI.default void
PUTs the source string using UTF8 charset to target URI.void
PUTs the source string to target URI.
-
Method Details
-
get
GETs the source URI content into target (does not have to exist, or will be overwritten if exist). The source MUST BE relative from theRemoteRepository.getUrl()
root.- Returns:
true
if operation succeeded,false
if source does not exist.- Throws:
RuntimeException
- If failed (and not due source not exists).
-
getBytes
GETs the source URI content as byte array. The source MUST BE relative from theRemoteRepository.getUrl()
root.- Returns:
- the byte array if operation succeeded,
null
if source does not exist. - Throws:
RuntimeException
- If failed (and not due source not exists).
-
getString
GETs the source URI content as string. The source MUST BE relative from theRemoteRepository.getUrl()
root.- Returns:
- the string if operation succeeded,
null
if source does not exist. - Throws:
RuntimeException
- If failed (and not due source not exists).
-
getString
GETs the source URI content as string using UTF8 charset. The source MUST BE relative from theRemoteRepository.getUrl()
root.- Returns:
- the string if operation succeeded,
null
if source does not exist. - Throws:
RuntimeException
- If failed (and not due source not exists).
-
put
PUTs the source file (must exist as file) to target URI. The target MUST BE relative from theRemoteRepository.getUrl()
root.- Throws:
RuntimeException
- If PUT fails for any reason.
-
putBytes
PUTs the source byte array to target URI. The target MUST BE relative from theRemoteRepository.getUrl()
root.- Throws:
RuntimeException
- If PUT fails for any reason.
-
putString
PUTs the source string to target URI. The target MUST BE relative from theRemoteRepository.getUrl()
root.- Throws:
RuntimeException
- If PUT fails for any reason.
-
putString
PUTs the source string using UTF8 charset to target URI. The target MUST BE relative from theRemoteRepository.getUrl()
root.- Throws:
RuntimeException
- If PUT fails for any reason.
-