gerrithudsontrigger/src/main/java/com/sonyericsson/hudson/plugins/gerrit/trigger/hudsontrigger/GerritDynamicUrlProcessor.java
/**
     * This is where the actual fetching is done. If everything goes well,
     * it returns a list of GerritProjects. If the fetched content hasn't changed
     * since the last fetch, it returns null.
     *
     * @param gerritTriggerConfigUrl the URL to fetch
     * @return a list of GerritProjects if successful, or null if no change
     * @throws ParseException when the fetched content couldn't be parsed
     * @throws IOException for all other kinds of fetch errors
     */
This is where the actual fetching is done. If everything goes well,
it returns a list of GerritProjects. If the fetched content hasn't changed
since the last fetch, it returns null.

@param gerritTriggerConfigUrl the URL to fetch
@return a list of GerritProjects if successful, or null if no change
@throws ParseException when the fetched content couldn't be parsed
@throws IOException for all other kinds of fetch errors
This is where the actual fetching is done . If everything goes well it returns a list of GerritProjects . If the fetched content hasn ' t changed since the last fetch it returns null . @param gerritTriggerConfigUrl the URL to fetch @return a list of GerritProjects if successful or null if no change @throws ParseException when the fetched content couldn ' t be parsed @throws IOException for all other kinds of fetch errors
public static List<GerritProject> fetch(String gerritTriggerConfigUrl)
            throws IOException, ParseException {
        if (gerritTriggerConfigUrl == null) {
          throw new MalformedURLException("The gerritTriggerConfigUrl is null");
        }
        if (gerritTriggerConfigUrl.isEmpty()) {
          throw new MalformedURLException("The gerritTriggerConfigUrl is empty");
        }
        URL url = new URL(gerritTriggerConfigUrl);
        URLConnection connection = url.openConnection();
        connection.setReadTimeout(SOCKET_READ_TIMEOUT);
        connection.setDoInput(true);
        InputStream instream = null;
        BufferedReader reader = null;
        try {
          instream = connection.getInputStream();
          reader = new BufferedReader(new InputStreamReader(instream));
          return readAndParseTriggerConfig(reader);
        } finally {
          if (reader != null) {
            reader.close();
          } else if (instream != null) {
            instream.close();
          }
        }
    }
public static List < GerritProject > fetch ( String gerritTriggerConfigUrl ) throws IOException , ParseException { if ( gerritTriggerConfigUrl == null ) { throw new MalformedURLException ( "The gerritTriggerConfigUrl is null" ) ; } if ( gerritTriggerConfigUrl . isEmpty ( ) ) { throw new MalformedURLException ( "The gerritTriggerConfigUrl is empty" ) ; } URL url = new URL ( gerritTriggerConfigUrl ) ; URLConnection connection = url . openConnection ( ) ; connection . setReadTimeout ( SOCKET_READ_TIMEOUT ) ; connection . setDoInput ( true ) ; InputStream instream = null ; BufferedReader reader = null ; try { instream = connection . getInputStream ( ) ; reader = new BufferedReader ( new InputStreamReader ( instream ) ) ; return readAndParseTriggerConfig ( reader ) ; } finally { if ( reader != null ) { reader . close ( ) ; } else if ( instream != null ) { instream . close ( ) ; } } }
This is where the actual fetching is done.
This is where the actual fetching is done .
// Prepare for fetching the URL