public static UrlAssetInfo create(AssetManager assetManager, AssetKey key, URL url) throws IOException { // Check if URL can be reached. This will throw // IOException which calling code will handle. URLConnection conn = url.openConnection(); conn.setUseCaches(false); InputStream in = conn.getInputStream(); // For some reason url cannot be reached? if (in == null){ return null; }else{ return new UrlAssetInfo(assetManager, key, url, in); } }
public AssetInfo locate(AssetManager manager, AssetKey key) { String name = key.getName(); try{ //TODO: remove workaround for SDK // URL url = new URL(root, name); if(name.startsWith("/")){ name = name.substring(1); } URL url = new URL(root.toExternalForm() + name); return UrlAssetInfo.create(manager, key, url); }catch (FileNotFoundException e){ return null; }catch (IOException ex){ logger.log(Level.WARNING, "Error while locating " + name, ex); return null; } }
return UrlAssetInfo.create(manager, key, url); }catch (IOException ex){
public static UrlAssetInfo create(AssetManager assetManager, AssetKey key, URL url) throws IOException { // Check if URL can be reached. This will throw // IOException which calling code will handle. URLConnection conn = url.openConnection(); conn.setUseCaches(false); InputStream in = conn.getInputStream(); // For some reason url cannot be reached? if (in == null){ return null; }else{ return new UrlAssetInfo(assetManager, key, url, in); } }
public AssetInfo locate(AssetManager manager, AssetKey key) { String name = key.getName(); try{ //TODO: remove workaround for SDK // URL url = new URL(root, name); if(name.startsWith("/")){ name = name.substring(1); } URL url = new URL(root.toExternalForm() + name); return UrlAssetInfo.create(manager, key, url); }catch (FileNotFoundException e){ return null; }catch (IOException ex){ logger.log(Level.WARNING, "Error while locating " + name, ex); return null; } }
return UrlAssetInfo.create(manager, key, url); }catch (IOException ex){