// Path: tinkerpatch-sdk/src/main/java/com/tencent/tinker/server/utils/Preconditions.java
// public final class Preconditions {
// 
//     private Preconditions() {
//         // TinkerServerUtils class.
//     }
// 
//     public static void checkArgument(boolean expression, String message) {
//         if (!expression) {
//             throw new IllegalArgumentException(message);
//         }
//     }
// 
//     public static <T> T checkNotNull(T arg) {
//         return checkNotNull(arg, "Argument must not be null");
//     }
// 
//     public static <T> T checkNotNull(T arg, String message) {
//         if (arg == null) {
//             throw new NullPointerException(message);
//         }
//         return arg;
//     }
// 
//     public static String checkNotEmpty(String string) {
//         if (TextUtils.isEmpty(string)) {
//             throw new IllegalArgumentException("Must not be null or empty");
//         }
//         return string;
//     }
// 
//     public static <T extends Collection<Y>, Y> T checkNotEmpty(T collection) {
//         if (collection.isEmpty()) {
//             throw new IllegalArgumentException("Must not be empty.");
//         }
//         return collection;
//     }
// }


import java.net.URL;
import java.util.HashMap;
import java.util.Map;
import android.net.Uri;
import android.text.TextUtils;
import com.tencent.tinker.server.utils.Preconditions;
import java.net.MalformedURLException;
/*
 * The MIT License (MIT)
 *
 * Copyright (c) 2016 Shengjie Sim Sun
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

package com.tencent.tinker.server.model;




public class TinkerClientUrl {

    private static final String ALLOWED_URI_CHARS = "@#&=*+-_.,:!?()/~'%";

    private final Headers headers;
    private final String  stringUrl;
    private final String  body;
    private final String  method;

    private String safeStringUrl;
    private URL    safeUrl;

    public TinkerClientUrl(String stringUrl, Headers headers, String body, String method) {
// Path: tinkerpatch-sdk/src/main/java/com/tencent/tinker/server/utils/Preconditions.java
// public final class Preconditions {
// 
//     private Preconditions() {
//         // TinkerServerUtils class.
//     }
// 
//     public static void checkArgument(boolean expression, String message) {
//         if (!expression) {
//             throw new IllegalArgumentException(message);
//         }
//     }
// 
//     public static <T> T checkNotNull(T arg) {
//         return checkNotNull(arg, "Argument must not be null");
//     }
// 
//     public static <T> T checkNotNull(T arg, String message) {
//         if (arg == null) {
//             throw new NullPointerException(message);
//         }
//         return arg;
//     }
// 
//     public static String checkNotEmpty(String string) {
//         if (TextUtils.isEmpty(string)) {
//             throw new IllegalArgumentException("Must not be null or empty");
//         }
//         return string;
//     }
// 
//     public static <T extends Collection<Y>, Y> T checkNotEmpty(T collection) {
//         if (collection.isEmpty()) {
//             throw new IllegalArgumentException("Must not be empty.");
//         }
//         return collection;
//     }
// }


// Path: tinkerpatch-sdk/src/main/java/com/tencent/tinker/server/model/TinkerClientUrl.java
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
import android.net.Uri;
import android.text.TextUtils;
import com.tencent.tinker.server.utils.Preconditions;
import java.net.MalformedURLException;

/*
 * The MIT License (MIT)
 *
 * Copyright (c) 2016 Shengjie Sim Sun
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

package com.tencent.tinker.server.model;




public class TinkerClientUrl {

    private static final String ALLOWED_URI_CHARS = "@#&=*+-_.,:!?()/~'%";

    private final Headers headers;
    private final String  stringUrl;
    private final String  body;
    private final String  method;

    private String safeStringUrl;
    private URL    safeUrl;

    public TinkerClientUrl(String stringUrl, Headers headers, String body, String method) {
        this.stringUrl = Preconditions.checkNotEmpty(stringUrl);