private InputStream getInputStream() throws FileNotFoundException { try { return new ReaderInputStream(new StringReader(content)); } catch (IOException ex) { throw new FileNotFoundException(ex.getLocalizedMessage()); } }
/** Get properties of the platform. * @return true if the initialization has been succesfull */ private boolean processProperties(final PrintWriter pw) { properties = new Properties(); try { execute(CMD_QUERY, pw); String output = emulatorOutput.toString(); if ("".equals(output)) //NOI18N output = emulatorError.toString(); properties.load(new ReaderInputStream(new StringReader(output))); } catch (IOException ex) { ErrorManager.getDefault().notify(org.openide.ErrorManager.INFORMATIONAL, ex); return false; } return true; } /*
private static Set<RakeTask> parseTasks(Reader is) throws IOException { Properties tasksProps = new Properties(); tasksProps.load(new ReaderInputStream(is));
/** Get version of the platform. * Loads temporary fields * @return true if load is successful */ private boolean processVersion(final PrintWriter pw) { versionProperties = new Properties(); try { execute(CMD_VERSION, pw); if (! resolveVersion(emulatorOutput)) if (! resolveVersion(emulatorError)) return false; // Platform detection modified because of #221063 and #228551 - Adding TC65 WTK as Java ME CLDC Platform final String output = emulatorOutput.toString(); if (output != null && !output.isEmpty()) { versionProperties.load(new ReaderInputStream(new StringReader(output))); } } catch (IOException ex) { ErrorManager.getDefault().notify(org.openide.ErrorManager.INFORMATIONAL, ex); return false; } // if (configuration == null) return false; // if (profile == null) return false; return true; }
LOGGER.finer("stdout:\n" + stdout); LOGGER.finer("stderr:\n " + stderr); props.load(new ReaderInputStream(new StringReader(stdout))); } else { props.load(proc.getInputStream());
FileUtil.copy(new ReaderInputStream(reader, charset), fos);