wro4j-core/src/main/java/ro/isdc/wro/model/resource/locator/UrlUriLocator.java
public InputStream locate(final String uri)
    throws IOException {
    notNull(uri, "uri cannot be NULL!");
    if (getWildcardStreamLocator().hasWildcard(uri)) {
      final String fullPath = FilenameUtils.getFullPath(uri);
      final URL url = new URL(fullPath);
      return getWildcardStreamLocator().locateStream(uri, new File(URLDecoder.decode(url.getFile(), "UTF-8")));
    }
    final URL url = new URL(uri);
    final URLConnection connection = url.openConnection();
    // avoid jar file locking on Windows.
    connection.setUseCaches(false);
    //add explicit user agent header. This is required by some cdn resources which otherwise would return 403 status code.
    connection.setRequestProperty("User-Agent", "java");
    // setting these timeouts ensures the client does not deadlock indefinitely
    // when the server has problems.
    connection.setConnectTimeout(timeout);
    connection.setReadTimeout(timeout);

    return new BufferedInputStream(connection.getInputStream());
  }
public InputStream locate(final String uri)
    throws IOException {
    notNull(uri, "uri cannot be NULL!");
    if (getWildcardStreamLocator().hasWildcard(uri)) {
      final String fullPath = FilenameUtils.getFullPath(uri);
      final URL url = new URL(fullPath);
      return getWildcardStreamLocator().locateStream(uri, new File(URLDecoder.decode(url.getFile(), "UTF-8")));
    }
    final URL url = new URL(uri);
    final URLConnection connection = url.openConnection();
    // avoid jar file locking on Windows.
    connection.setUseCaches(false);
    //add explicit user agent header. This is required by some cdn resources which otherwise would return 403 status code.
    connection.setRequestProperty("User-Agent", "java");
    // setting these timeouts ensures the client does not deadlock indefinitely
    // when the server has problems.
    connection.setConnectTimeout(timeout);
    connection.setReadTimeout(timeout);

    return new BufferedInputStream(connection.getInputStream());
  }
public InputStream locate ( final String uri ) throws IOException { notNull ( uri , "uri cannot be NULL!" ) ; if ( getWildcardStreamLocator ( ) . hasWildcard ( uri ) ) { final String fullPath = FilenameUtils . getFullPath ( uri ) ; final URL url = new URL ( fullPath ) ; return getWildcardStreamLocator ( ) . locateStream ( uri , new File ( URLDecoder . decode ( url . getFile ( ) , "UTF-8" ) ) ) ; } final URL url = new URL ( uri ) ; final URLConnection connection = url . openConnection ( ) ; // avoid jar file locking on Windows. connection . setUseCaches ( false ) ; //add explicit user agent header. This is required by some cdn resources which otherwise would return 403 status code. connection . setRequestProperty ( "User-Agent" , "java" ) ; // setting these timeouts ensures the client does not deadlock indefinitely // when the server has problems. connection . setConnectTimeout ( timeout ) ; connection . setReadTimeout ( timeout ) ; return new BufferedInputStream ( connection . getInputStream ( ) ) ; }
{@inheritDoc}
{