Examples of openConnection()


Examples of java.net.URL.openConnection()

                        String urlStr = urls[i].toString();
                        if (urlStr.startsWith(FILE_PROTOCOL)
                                && urlStr.endsWith(JAR_FILE_SUFFIX)
                                && needScanJar(loader, webappLoader, urlStr)) {
                            URL jarURL = new URL("jar:" + urlStr + "!/");
                            scanJar((JarURLConnection) jarURL.openConnection(),
                                    true);
                        }
                    }
                }
            }
View Full Code Here

Examples of java.net.URL.openConnection()

    return null;
  }

  private InputStream openStreamForLocalUrl(final String localUrl) throws MalformedURLException, IOException {
    URL url = new URL("http://" + mConfig.getDreamboxAddress() + localUrl);
    URLConnection connection = url.openConnection();

    // set user and password
    String userpassword = mConfig.getUserName() + ":" + mConfig.getPassword();
    String encoded = new String(Base64.encodeBase64(userpassword.getBytes()));
    connection.setRequestProperty("Authorization", "Basic " + encoded);
View Full Code Here

Examples of java.net.URL.openConnection()

     */
    public TreeMap<String, String> getServiceDataBonquets(String service) {
        try {
            URL url = new URL("http://" + mProperties.getProperty("ip","") + "/web/getservices?bRef=" + service);

            URLConnection connection = url.openConnection();

            String userpassword = mProperties.getProperty("username", "") + ":" + IOUtilities.xorEncode(mProperties.getProperty("password", ""), DreamboxSettingsPanel.PASSWORDSEED);
            String encoded = new String(Base64.encodeBase64(userpassword.getBytes()));
            connection.setRequestProperty("Authorization", "Basic " + encoded);

View Full Code Here

Examples of java.net.URL.openConnection()

     * @return Data of specific service
     */
    public TreeMap<String, String> getServiceData(String service) {
        try {
            URL url = new URL("http://" + mProperties.getProperty("ip", "") + "/web/getservices?sRef=" + service);
            URLConnection connection = url.openConnection();

            String userpassword = mProperties.getProperty("username", "") + ":" + IOUtilities.xorEncode(mProperties.getProperty("password", ""), DreamboxSettingsPanel.PASSWORDSEED);
            String encoded = new String(Base64.encodeBase64(userpassword.getBytes()));
            connection.setRequestProperty("Authorization", "Basic " + encoded);

View Full Code Here

Examples of java.net.URL.openConnection()

    private void getEPGData(TvDataUpdateManager updateManager, Channel ch) {
        try {
            URL url = new URL("http://" + mProperties.getProperty("ip", "") + "/web/epgservice?sRef=" + StringUtils.replace(StringUtils.replace(ch.getId().substring(5), "_", ":"), " ", "%20"));

            URLConnection connection = url.openConnection();

            String userpassword = mProperties.getProperty("username", "") + ":" + IOUtilities.xorEncode(mProperties.getProperty("password", ""), DreamboxSettingsPanel.PASSWORDSEED);
            String encoded = new String(Base64.encodeBase64(userpassword.getBytes()));
            connection.setRequestProperty("Authorization", "Basic " + encoded);
View Full Code Here

Examples of java.net.URL.openConnection()

   *           If the device could not be contacted
   */
  private StringBuffer readDeviceData(String page) throws TopfieldConnectionException {
    try {
      URL deviceURL = configuration.getDeviceURL(page);
      URLConnection connection = deviceURL.openConnection();
      connection.setConnectTimeout(configuration.getConnectionTimeout());
      InputStream contentStream = (InputStream) connection.getContent();
      BufferedReader in = new BufferedReader(new InputStreamReader(contentStream));
      StringBuffer content = new StringBuffer();
      String line;
View Full Code Here

Examples of java.net.URL.openConnection()

              .get(Calendar.MONTH) + 1, recordStart.get(Calendar.YEAR), recordStart.get(Calendar.HOUR_OF_DAY),
              recordStart.get(Calendar.MINUTE), recordTime.getLength() / 60, recordTime.getLength() % 60);
        }

        URL deviceURL = configuration.getDeviceURL(INSERT_TIMER_PAGE);
        URLConnection connection = deviceURL.openConnection();
        connection.setConnectTimeout(configuration.getConnectionTimeout());
        connection.setDoOutput(true);
        OutputStreamWriter connectionWriter = new OutputStreamWriter(connection.getOutputStream());
        connectionWriter.write(request);
        connectionWriter.close();
View Full Code Here

Examples of java.net.URL.openConnection()

   */
  public boolean deleteRecording(Window parent, TopfieldTimerEntry entry) throws TopfieldConnectionException {
    String request = String.format(DELETE_FORMAT, entry.getEntryNumber());
    try {
      URL deviceURL = configuration.getDeviceURL(DELETE_TIMER_PAGE);
      URLConnection connection = deviceURL.openConnection();
      connection.setConnectTimeout(configuration.getConnectionTimeout());
      connection.setDoOutput(true);
      OutputStreamWriter connectionWriter = new OutputStreamWriter(connection.getOutputStream());
      connectionWriter.write(request);
      connectionWriter.close();
View Full Code Here

Examples of java.net.URL.openConnection()

                .append("&channel=")
                .append(channel.getId());
        System.out.println(buf);
        URL url = new URL(buf.toString());

        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        InputStream in = con.getInputStream();

        BufferedReader reader = new BufferedReader(new InputStreamReader(in));

        Matcher matcher;
View Full Code Here

Examples of java.net.URL.openConnection()

protected void writeReportFile(String fileName) {
    URLConnection conn = null;

    try {
  URL url = new URL(fileName);
  conn = url.openConnection();
  conn.setDoOutput(true);

  sendData(conn);
  // I don't know why, but we have to read the response from the
  // server, even if it's empty.
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.