/** * Returns a stream to a local pack. * * @param name the pack name * @return the pack stream */ private InputStream getLocalPackStream(String name) { return resources.getInputStream("packs/pack-" + name); }
/** * Returns the stream to a resource. * * @param name the resource name * @return a stream to the resource * @throws ResourceNotFoundException if the resource cannot be found * @throws ResourceException for any other resource error */ @Override public InputStream getInputStream(String name) { // TODO - this is invoked to get multi-volume info, so should check on web dir. return resources.getInputStream(name); }
/** * Gets the stream to a resource. * * @param res The resource id. * @return The resource value, null if not found */ public InputStream getResource(String res) { try { // System.out.println ("retrieving resource " + res); return resources.getInputStream(res); } catch (ResourceNotFoundException exception) { return null; } }
/** * Returns a stream to the messages for the given ISO code. * * @param code the 2 or 3 character ISO language code * @return the stream, or {@code null} if none was found */ private InputStream getMessagesStream(String code) { InputStream result = null; try { String path = "langpacks/" + code + ".xml"; result = resources.getInputStream(path); } catch (ResourceNotFoundException ignore) { logger.fine("Locale has no langpack for code: " + code); } return result; }
/** * Returns the named messages for the current locale. * * @param name the message resource name * @return messages for the current locale * @throws ResourceNotFoundException if the named resource cannot be found */ @Override public Messages getMessages(String name) { InputStream in = resources.getInputStream(name); return new LocaleDatabase(in, this); }
/** * Initialises the listener. * * @throws IzPackException for any error */ @Override public void initialise() { // Load the defined actions. try { InputStream in = resources.getInputStream("registryEntries"); ObjectInputStream objIn = new ObjectInputStream(in); actions = (List) objIn.readObject(); objIn.close(); in.close(); } catch (ResourceNotFoundException ignore) { // do nothing } catch (Exception exception) { throw new IzPackException(exception); } }
/** * Loads custom icons into the installer. * * @param icons the icons database * @param resources used to load the icons * @throws Exception */ private void loadCustomIcons(IconsDatabase icons, Resources resources) throws Exception { // We try to load and add a custom langpack. InputStream inXML = null; try { inXML = resources.getInputStream(Resources.CUSTOM_ICONS_RESOURCE_NAME); } catch (Throwable exception) { logger.fine("Resource " + Resources.CUSTOM_ICONS_RESOURCE_NAME + " not defined. No custom icons available"); return; } logger.fine("Custom icons available"); parseXML(inXML, icons); }
props.load(resources.getInputStream("/com/izforge/izpack/installer/win32-defaultpaths.properties"));
try in = resources.getInputStream("bsfActions"); ObjectInputStream objIn = new ObjectInputStream(in); actions = (List<BSFAction>) objIn.readObject();
in = resources.getInputStream(_targetPanel + ".dir.".concat(os)); in = resources.getInputStream(_targetPanel + ".dir.windows"); in = resources.getInputStream(_targetPanel + ".dir.mac"); in = resources.getInputStream(_targetPanel + ".dir.unix"); in = resources.getInputStream(_targetPanel + ".dir");
try input = resources.getInputStream(SPEC_RESOURCE_NAME);
try shortcutSpec = resources.getInputStream(TargetFactory.getCurrentOSPrefix() + SPEC_FILE_NAME); shortcutSpec = resources.getInputStream(SPEC_FILE_NAME);
try in = resources.getInputStream(UNINSTALLER_ICON); String iconPath = installData.getVariable("INSTALL_PATH") + File.separator + "Uninstaller" + File.separator + "UninstallerIcon.ico";
try input = resources.getInputStream(SPEC_RESOURCE_NAME);
try is = new VariableSubstitutorInputStream(resources.getInputStream(replacer.substitute(src)), variables, SubstitutionType.TYPE_PLAIN, false); action.setScript(IOUtils.toString(is, is.getEncoding()));
InputStream in = resources.getInputStream("packs.info"); ObjectInputStream objIn = new ObjectInputStream(in); List<PackInfo> packs;