/** * Loads a set of region metadata from an XML file on disk. * * @param file the file to load from * @return the loaded region metadata * @throws IOException on error opening or reading from the file */ @Deprecated public static RegionMetadata loadMetadataFromFile(final File file) throws IOException { return LegacyRegionXmlLoadUtils.load(file); }
/** * Loads a set of region metadata by downloading an XML file from the * given URI and parsing it. * * @param uri the uri of the XML file to parse * @param config configuration for the HTTP client to use to fetch the file * @return the parsed region metadata * @throws IOException on error fetching or parsing the XML file */ @Deprecated public static RegionMetadata loadMetadataFromURI( final URI uri, final ClientConfiguration config) throws IOException { return LegacyRegionXmlLoadUtils.load(uri, config); }
/** * Loads a set of region metadata from an arbitrary {@code InputStream} * containing an XML file. * * @param stream the stream to load from * @return the loaded region metadata * @throws IOException on error reading from the stream */ @Deprecated public static RegionMetadata loadMetadataFromInputStream( final InputStream stream) throws IOException { return LegacyRegionXmlLoadUtils.load(stream); }
/** * Loads a set of region metadata from an XML file stored as a resource * of the classloader used to load the RegionUtils class. * * @param name the path of the resource, relative to the RegionUtils class * @return the parsed region metadata * @throws IOException if the resource is not found or cannot be parsed */ @Deprecated public static RegionMetadata loadMetadataFromResource(final String name) throws IOException { return LegacyRegionXmlLoadUtils.load(RegionUtils .class, name); }
/** * Loads a set of region metadata from an XML file stored as a resource of * the classloader used to load the given class. * * @param clazz the class to use as a base for the resource * @param name the path to the resource, relative to the given class * @return the parsed region metadata * @throws IOException if the resource is not found or cannot be parsed */ @Deprecated public static RegionMetadata loadMetadataFromResource( final Class<?> clazz, final String name) throws IOException { return LegacyRegionXmlLoadUtils.load(clazz, name); }
/** * Loads a set of region metadata from an XML file stored as a resource * of the given classloader. * * @param classLoader the class loader to load the resource from * @param name the path to the resource * @return the parsed region metadata * @throws IOException if the resource is not found or cannot be parsed */ @Deprecated public static RegionMetadata loadMetadataFromResource( final ClassLoader classLoader, final String name) throws IOException { return LegacyRegionXmlLoadUtils.load(classLoader, name); }
/** * Loads region metadata from file location specified in * {@link #REGIONS_FILE_OVERRIDE} property. * Returns null if no such property exists. * * @throws SdkClientException if any error occurs while loading the * metadata file. */ private RegionMetadata loadFromStream(final InputStream stream) { try { return LegacyRegionXmlLoadUtils.load(stream); } catch (IOException exception) { throw new SdkClientException( "Error parsing region metadata from input stream", exception); } } }
/** * Loads a set of region metadata from an XML file stored as a resource of * the classloader used to load the given class. * * @param clazz the class to use as a base for the resource * @param name the path to the resource, relative to the given class * @return the parsed region metadata * @throws IOException if the resource is not found or cannot be parsed */ public static RegionMetadata load( final Class<?> clazz, final String name) throws IOException { InputStream stream = clazz.getResourceAsStream(name); if (stream == null) { throw new FileNotFoundException( "No resource '" + name + "' found."); } return load(stream); }
/** * Loads a set of region metadata from an XML file stored as a resource * of the given classloader. * * @param classLoader the class loader to load the resource from * @param name the path to the resource * @return the parsed region metadata * @throws IOException if the resource is not found or cannot be parsed */ public static RegionMetadata load( final ClassLoader classLoader, final String name) throws IOException { InputStream stream = classLoader.getResourceAsStream(name); if (stream == null) { throw new FileNotFoundException( "No resource '" + name + "' found."); } return load(stream); } }
/** * Loads region metadata from file location specified in * {@link #REGIONS_FILE_OVERRIDE} property. * Returns null if no such property exists. * * @throws SdkClientException if any error occurs while loading the * metadata file. */ private RegionMetadata loadFromSystemProperty() { final String overrideFilePath = System.getProperty (REGIONS_FILE_OVERRIDE); if (overrideFilePath != null) { try { return LegacyRegionXmlLoadUtils.load(new File (overrideFilePath)); } catch (IOException exception) { throw new SdkClientException( "Error parsing region metadata from " + overrideFilePath, exception); } } return null; }
/** * Loads a set of region metadata from an XML file on disk. * * @param file the file to load from * @return the loaded region metadata * @throws IOException on error opening or reading from the file */ @Deprecated public static RegionMetadata loadMetadataFromFile(final File file) throws IOException { return LegacyRegionXmlLoadUtils.load(file); }
/** * Loads a set of region metadata from an arbitrary {@code InputStream} * containing an XML file. * * @param stream the stream to load from * @return the loaded region metadata * @throws IOException on error reading from the stream */ @Deprecated public static RegionMetadata loadMetadataFromInputStream( final InputStream stream) throws IOException { return LegacyRegionXmlLoadUtils.load(stream); }
/** * Loads a set of region metadata by downloading an XML file from the * given URI and parsing it. * * @param uri the uri of the XML file to parse * @param config configuration for the HTTP client to use to fetch the file * @return the parsed region metadata * @throws IOException on error fetching or parsing the XML file */ @Deprecated public static RegionMetadata loadMetadataFromURI( final URI uri, final ClientConfiguration config) throws IOException { return LegacyRegionXmlLoadUtils.load(uri, config); }
/** * Loads a set of region metadata from an XML file stored as a resource * of the classloader used to load the RegionUtils class. * * @param name the path of the resource, relative to the RegionUtils class * @return the parsed region metadata * @throws IOException if the resource is not found or cannot be parsed */ @Deprecated public static RegionMetadata loadMetadataFromResource(final String name) throws IOException { return LegacyRegionXmlLoadUtils.load(RegionUtils .class, name); }
/** * Loads a set of region metadata from an XML file stored as a resource * of the given classloader. * * @param classLoader the class loader to load the resource from * @param name the path to the resource * @return the parsed region metadata * @throws IOException if the resource is not found or cannot be parsed */ @Deprecated public static RegionMetadata loadMetadataFromResource( final ClassLoader classLoader, final String name) throws IOException { return LegacyRegionXmlLoadUtils.load(classLoader, name); }
/** * Loads a set of region metadata from an XML file stored as a resource of * the classloader used to load the given class. * * @param clazz the class to use as a base for the resource * @param name the path to the resource, relative to the given class * @return the parsed region metadata * @throws IOException if the resource is not found or cannot be parsed */ @Deprecated public static RegionMetadata loadMetadataFromResource( final Class<?> clazz, final String name) throws IOException { return LegacyRegionXmlLoadUtils.load(clazz, name); }
/** * Loads region metadata from file location specified in * {@link #REGIONS_FILE_OVERRIDE} property. * Returns null if no such property exists. * * @throws SdkClientException if any error occurs while loading the * metadata file. */ private RegionMetadata loadFromStream(final InputStream stream) { try { return LegacyRegionXmlLoadUtils.load(stream); } catch (IOException exception) { throw new SdkClientException( "Error parsing region metadata from input stream", exception); } } }
/** * Loads a set of region metadata from an XML file stored as a resource * of the given classloader. * * @param classLoader the class loader to load the resource from * @param name the path to the resource * @return the parsed region metadata * @throws IOException if the resource is not found or cannot be parsed */ public static RegionMetadata load( final ClassLoader classLoader, final String name) throws IOException { InputStream stream = classLoader.getResourceAsStream(name); if (stream == null) { throw new FileNotFoundException( "No resource '" + name + "' found."); } return load(stream); } }
/** * Loads a set of region metadata from an XML file stored as a resource of * the classloader used to load the given class. * * @param clazz the class to use as a base for the resource * @param name the path to the resource, relative to the given class * @return the parsed region metadata * @throws IOException if the resource is not found or cannot be parsed */ public static RegionMetadata load( final Class<?> clazz, final String name) throws IOException { InputStream stream = clazz.getResourceAsStream(name); if (stream == null) { throw new FileNotFoundException( "No resource '" + name + "' found."); } return load(stream); }
/** * Loads region metadata from file location specified in * {@link #REGIONS_FILE_OVERRIDE} property. * Returns null if no such property exists. * * @throws SdkClientException if any error occurs while loading the * metadata file. */ private RegionMetadata loadFromSystemProperty() { final String overrideFilePath = System.getProperty (REGIONS_FILE_OVERRIDE); if (overrideFilePath != null) { try { return LegacyRegionXmlLoadUtils.load(new File (overrideFilePath)); } catch (IOException exception) { throw new SdkClientException( "Error parsing region metadata from " + overrideFilePath, exception); } } return null; }