Code example for URLConnection

Methods: getContentLengthgetInputStream

      IProgressMonitor monitor) throws IOException {
    URLConnection connection = downloadUrl.openConnection();
    FileOutputStream out = new FileOutputStream(destFile);
    int length = connection.getContentLength();
    monitor.beginTask(taskName, length);
    copyStream(connection.getInputStream(), out, monitor, length);
   * Ensure that the execute bit is set on the given files. 
   * @param files the files that should be executable 
  public static void ensureExecutable(File... files) {
    if (files != null) {
      for (File file : files) {
Connect your IDE to all the code out there  Get Codota for Java