コード例 #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
ファイル: URLEncoder.java プロジェクト: hakeemsm/XobotOS
 /** 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
ファイル: URLEncoder.java プロジェクト: hakeemsm/XobotOS
 /**
  * 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);
 }