예제 #1
0
 /**
  * Creates an instance of <code>FileURLConnection</code> for establishing
  * a connection to the file pointed by this <code>URL<code>
  *
  * @param url The URL this connection is connected to
  */
 public FileURLConnection(URL url) {
   super(url);
   fileName = url.getFile();
   if (fileName == null) {
     fileName = "";
   }
   fileName = UriCodec.decode(fileName);
 }
예제 #2
0
 /** Encodes {@code s} using the {@link Charset} named by {@code charsetName}. */
 public static String encode(String s, String charsetName) throws UnsupportedEncodingException {
   return ENCODER.encode(s, Charset.forName(charsetName));
 }
예제 #3
0
 /**
  * Equivalent to {@code encode(s, "UTF-8")}.
  *
  * @deprecated use {@link #encode(String, String)} instead.
  */
 @Deprecated
 public static String encode(String s) {
   return ENCODER.encode(s, Charsets.UTF_8);
 }