Package org.sonar.api.utils
Class UriReader
- java.lang.Object
-
- org.sonar.api.utils.UriReader
-
@ScannerSide @ServerSide @ComputeEngineSide public class UriReader extends java.lang.Object
Reads different types of URI. Supported schemes are http and file.- Since:
- 3.2
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
UriReader.SchemeProcessor
-
Constructor Summary
Constructors Constructor Description UriReader(UriReader.SchemeProcessor[] processors)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
description(java.net.URI uri)
Returns a detailed description of the given uri.byte[]
readBytes(java.net.URI uri)
Reads all bytes from uri.java.lang.String
readString(java.net.URI uri, java.nio.charset.Charset charset)
Reads all characters from uri, using the given character set.
-
-
-
Constructor Detail
-
UriReader
public UriReader(UriReader.SchemeProcessor[] processors)
-
-
Method Detail
-
readBytes
public byte[] readBytes(java.net.URI uri)
Reads all bytes from uri. It throws an unchecked exception if an error occurs.
-
readString
public java.lang.String readString(java.net.URI uri, java.nio.charset.Charset charset)
Reads all characters from uri, using the given character set. It throws an unchecked exception if an error occurs.
-
description
public java.lang.String description(java.net.URI uri)
Returns a detailed description of the given uri. For example HTTP URIs are completed with the configured HTTP proxy.
-
-