public InputStream getMessageBundle() { return FileUtils.getInputStream(getClass(), "messages.properties"); } }
public InputStream getMessageBundle() { return FileUtils.getInputStream(getClass(), "messages_es.properties"); } }
public InputStream getFlagGraphic() { return FileUtils.getInputStream(getClass(), "es.png"); }
public InputStream getFlagGraphic() { return FileUtils.getInputStream(getClass(), "gb.png"); }
public Document getDocumentTemplate(final String templateName) { return XmlUtils.readXml(FileUtils.getInputStream(getClass(), templateName)); } }
@Override public Properties loadProperties(final String filename, final Class<?> loadingClass) { return loadProperties(FileUtils.getInputStream(loadingClass, filename)); }
/** * Returns the root element of the given XML file. * * @param clazz the class from whose package to open the file (required) * @param xmlFilePath the path of the XML file relative to the given class' * package (required) * @return a non-<code>null</code> element * @see Document#getDocumentElement() */ public static Element getRootElement(final Class<?> clazz, final String xmlFilePath) { final InputStream inputStream = FileUtils.getInputStream(clazz, xmlFilePath); Validate.notNull(inputStream, "Could not open the file '%s'", xmlFilePath); return readXml(inputStream).getDocumentElement(); }
JavaType modelObject) { String fileIdentifier = targetDirectory.concat(String.format("/%s-flow.xml", this.flowName)); InputStream inputStream = FileUtils.getInputStream(this.getClass(), "flow-template.xml");
private void setUpLog4jConfiguration() { final String log4jConfigFile = getPathResolver().getFocusedIdentifier(Path.SRC_MAIN_RESOURCES, "log4j.properties"); final InputStream templateInputStream = FileUtils.getInputStream(getClass(), "log4j.properties-template"); OutputStream outputStream = null; try { outputStream = getFileManager().createFile(log4jConfigFile).getOutputStream(); IOUtils.copy(templateInputStream, outputStream); } catch (final IOException e) { LOGGER.warning("Unable to install log4j logging configuration"); } finally { IOUtils.closeQuietly(templateInputStream); IOUtils.closeQuietly(outputStream); } }
private void copyFile(String fileName, String folder) { String file; LogicalPath rootPath = LogicalPath.getInstance(Path.ROOT, ""); if (folder != null) { file = pathResolver.getIdentifier(rootPath, folder + "/src/main/resources/" + fileName); } else { file = pathResolver.getIdentifier(rootPath, fileName); } InputStream inputStream = null; OutputStream outputStream = null; try { inputStream = FileUtils.getInputStream(getClass(), "resources/" + fileName); if (!fileManager.exists(file)) { outputStream = fileManager.createFile(file).getOutputStream(); } if (outputStream != null) { IOUtils.copy(inputStream, outputStream); } } catch (final IOException ioe) { throw new IllegalStateException(ioe); } finally { IOUtils.closeQuietly(inputStream); if (outputStream != null) { IOUtils.closeQuietly(outputStream); } } }
inputStream = FileUtils.getInputStream(getClass(), "SpringBootApplication-template._java"); String input = IOUtils.toString(inputStream);
FileUtils.getInputStream(getClass(), type.name().toLowerCase() + "/" + targetFilename + "-template"); OutputStream outputStream = null;
try { inputStream = FileUtils.getInputStream(getClass(), "ReadOnlyRepository-template._java"); String input = IOUtils.toString(inputStream);
private void writeAssemblyFile(JavaPackage topLevelPackage, String templateName, String destinationFolder) { final InputStream templateInputStream = FileUtils.getInputStream(getClass(), "xml/" + templateName);
FileUtils.getInputStream(getClass(), type.name().toLowerCase() + "/obr-template.xml"); final Document docXml = XmlUtils.readXml(templateInputStream); final Element document = docXml.getDocumentElement();
FileUtils.getInputStream(getClass(), "wrapper/roo-addon-wrapper-template.xml"); final Document pom = XmlUtils.readXml(templateInputStream); final Element root = pom.getDocumentElement();
FileUtils.getInputStream(getClass(), "ConcurrencyExceptionManager-template._java"); String input = IOUtils.toString(inputStream);
inputStream = FileUtils.getInputStream(getClass(), templateName); String input = IOUtils.toString(inputStream);
try { inputStream = FileUtils.getInputStream(getClass(), "RepositoryCustomImpl-template._java"); String input = IOUtils.toString(inputStream);
FileUtils.getInputStream(getClass(), type.name().toLowerCase() + "/roo-addon-" + type.name().toLowerCase() + "-template.xml"); final Document pom = XmlUtils.readXml(templateInputStream);