Java Code Examples for de.blinkt.openvpn.VpnProfile#INLINE_TAG

The following examples show how to use de.blinkt.openvpn.VpnProfile#INLINE_TAG . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ConfigParser.java    From Cake-VPN with GNU General Public License v2.0 6 votes vote down vote up
private void checkinlinefile(Vector<String> args, BufferedReader br) throws IOException, ConfigParseError {
    String arg0 = args.get(0).trim();
    // CHeck for <foo>
    if (arg0.startsWith("<") && arg0.endsWith(">")) {
        String argname = arg0.substring(1, arg0.length() - 1);
        String inlinefile = VpnProfile.INLINE_TAG;
        String endtag = String.format("</%s>", argname);
        do {
            String line = br.readLine();
            if (line == null) {
                throw new ConfigParseError(String.format("No endtag </%s> for starttag <%s> found", argname, argname));
            }
            if (line.trim().equals(endtag)) break;
            else {
                inlinefile += line;
                inlinefile += "\n";
            }
        } while (true);
        if (inlinefile.endsWith("\n")) inlinefile = inlinefile.substring(0, inlinefile.length() - 1);
        args.clear();
        args.add(argname);
        args.add(inlinefile);
    }
}
 
Example 2
Source File: ConfigParser.java    From Cybernet-VPN with GNU General Public License v3.0 6 votes vote down vote up
private void checkinlinefile(Vector<String> args, BufferedReader br) throws IOException, ConfigParseError {
    String arg0 = args.get(0).trim();
    // CHeck for <foo>
    if (arg0.startsWith("<") && arg0.endsWith(">")) {
        String argname = arg0.substring(1, arg0.length() - 1);
        String inlinefile = VpnProfile.INLINE_TAG;
        String endtag = String.format("</%s>", argname);
        do {
            String line = br.readLine();
            if (line == null) {
                throw new ConfigParseError(String.format("No endtag </%s> for starttag <%s> found", argname, argname));
            }
            if (line.trim().equals(endtag)) break;
            else {
                inlinefile += line;
                inlinefile += "\n";
            }
        } while (true);
        if (inlinefile.endsWith("\n")) inlinefile = inlinefile.substring(0, inlinefile.length() - 1);
        args.clear();
        args.add(argname);
        args.add(inlinefile);
    }
}
 
Example 3
Source File: ConfigParser.java    From SimpleOpenVpn-Android with Apache License 2.0 5 votes vote down vote up
private void checkinlinefile(Vector<String> args, BufferedReader br) throws IOException, ConfigParseError {
    String arg0 = args.get(0).trim();
    // CHeck for <foo>
    if (arg0.startsWith("<") && arg0.endsWith(">")) {
        String argname = arg0.substring(1, arg0.length() - 1);
        String inlinefile = VpnProfile.INLINE_TAG;

        String endtag = String.format("</%s>", argname);
        do {
            String line = br.readLine();
            if (line == null) {
                throw new ConfigParseError(String.format("No endtag </%s> for starttag <%s> found", argname, argname));
            }
            if (line.trim().equals(endtag))
                break;
            else {
                inlinefile += line;
                inlinefile += "\n";
            }
        } while (true);

        args.clear();
        args.add(argname);
        args.add(inlinefile);
    }

}
 
Example 4
Source File: ConfigParser.java    From EasyVPN-Free with GNU General Public License v3.0 5 votes vote down vote up
private void checkinlinefile(Vector<String> args, BufferedReader br) throws IOException, ConfigParseError {
    String arg0 = args.get(0).trim();
    // CHeck for <foo>
    if (arg0.startsWith("<") && arg0.endsWith(">")) {
        String argname = arg0.substring(1, arg0.length() - 1);
        String inlinefile = VpnProfile.INLINE_TAG;

        String endtag = String.format("</%s>", argname);
        do {
            String line = br.readLine();
            if (line == null) {
                throw new ConfigParseError(String.format("No endtag </%s> for starttag <%s> found", argname, argname));
            }
            if (line.trim().equals(endtag))
                break;
            else {
                inlinefile += line;
                inlinefile += "\n";
            }
        } while (true);

        args.clear();
        args.add(argname);
        args.add(inlinefile);
    }

}
 
Example 5
Source File: ConfigParser.java    From bitmask_android with GNU General Public License v3.0 5 votes vote down vote up
private void checkinlinefile(Vector<String> args, BufferedReader br) throws IOException, ConfigParseError {
    String arg0 = args.get(0).trim();
    // CHeck for <foo>
    if (arg0.startsWith("<") && arg0.endsWith(">")) {
        String argname = arg0.substring(1, arg0.length() - 1);
        String inlinefile = VpnProfile.INLINE_TAG;

        String endtag = String.format("</%s>", argname);
        do {
            String line = br.readLine();
            if (line == null) {
                throw new ConfigParseError(String.format("No endtag </%s> for starttag <%s> found", argname, argname));
            }
            if (line.trim().equals(endtag))
                break;
            else {
                inlinefile += line;
                inlinefile += "\n";
            }
        } while (true);

        if (inlinefile.endsWith("\n"))
            inlinefile = inlinefile.substring(0, inlinefile.length() - 1);

        args.clear();
        args.add(argname);
        args.add(inlinefile);
    }

}