org.sonar.api.utils
Class UriReader

java.lang.Object
  extended by org.sonar.api.utils.UriReader
All Implemented Interfaces:
BatchComponent, ServerComponent

public class UriReader
extends Object
implements BatchComponent, ServerComponent

Reads different types of URI. Supported schemes are http and file.

Since:
3.2

Constructor Summary
UriReader(org.sonar.api.utils.UriReader.SchemeProcessor[] processors)
           
 
Method Summary
 String description(URI uri)
          Returns a detailed description of the given uri.
 byte[] readBytes(URI uri)
          Reads all bytes from uri.
 String readString(URI uri, Charset charset)
          Reads all characters from uri, using the given character set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UriReader

public UriReader(org.sonar.api.utils.UriReader.SchemeProcessor[] processors)
Method Detail

readBytes

public byte[] readBytes(URI uri)
Reads all bytes from uri. It throws an unchecked exception if an error occurs.


readString

public String readString(URI uri,
                         Charset charset)
Reads all characters from uri, using the given character set. It throws an unchecked exception if an error occurs.


description

public String description(URI uri)
Returns a detailed description of the given uri. For example HTTP URIs are completed with the configured HTTP proxy.



Copyright © 2009-2013 SonarSource. All Rights Reserved.