private Map<String, String> loadProfile(URL profileURL) { if (profileURL == null) return null; try { InputStream stream = profileURL.openStream(); return loadProfile(stream); } catch (IOException e) { //null } return null; }
private Map<String, String> loadProfile(URL profileURL) { if (profileURL == null) return null; try { InputStream stream = profileURL.openStream(); return loadProfile(stream); } catch (IOException e) { //null } return null; }
private Map<String, String> loadProfile(URL profileURL) { if (profileURL == null) return null; try { InputStream stream = profileURL.openStream(); return loadProfile(stream); } catch (IOException e) { //null } return null; }
private Map<String, String> loadProfile(URL profileURL) { if (profileURL == null) return null; try { InputStream stream = profileURL.openStream(); return loadProfile(stream); } catch (IOException e) { //null } return null; }
private Map<String, String> loadProfile(File profileFile) { if (profileFile == null || !profileFile.exists()) return null; try { InputStream stream = new BufferedInputStream(new FileInputStream(profileFile)); Map<String, String> properties = loadProfile(stream); if (properties != null) properties.put(PROFILE_LOCATION, profileFile.getAbsolutePath()); return properties; } catch (FileNotFoundException e) { //null } return null; }
private Map<String, String> loadProfile(File profileFile) { if (profileFile == null || !profileFile.exists()) return null; try { InputStream stream = new BufferedInputStream(new FileInputStream(profileFile)); Map<String, String> properties = loadProfile(stream); if (properties != null) properties.put(PROFILE_LOCATION, profileFile.getAbsolutePath()); return properties; } catch (FileNotFoundException e) { //null } return null; }
private Map<String, String> loadProfile(File profileFile) { if (profileFile == null || !profileFile.exists()) return null; try { InputStream stream = new BufferedInputStream(new FileInputStream(profileFile)); Map<String, String> properties = loadProfile(stream); if (properties != null) properties.put(PROFILE_LOCATION, profileFile.getAbsolutePath()); return properties; } catch (FileNotFoundException e) { //null } return null; }
private Map<String, String> loadProfile(File profileFile) { if (profileFile == null || !profileFile.exists()) return null; try { InputStream stream = new BufferedInputStream(new FileInputStream(profileFile)); Map<String, String> properties = loadProfile(stream); if (properties != null) properties.put(PROFILE_LOCATION, profileFile.getAbsolutePath()); return properties; } catch (FileNotFoundException e) { //null } return null; }
private void initialize(IPublisherInfo publisherInfo) { this.info = publisherInfo; if (jreLocation != null) { File javaProfile = null; if (jreLocation.isDirectory()) { //Look for a JRE profile file to set version and capabilities File[] profiles = jreLocation.listFiles(new FileFilter() { public boolean accept(File pathname) { return pathname.getAbsolutePath().endsWith(".profile"); //$NON-NLS-1$ } }); if (profiles != null && profiles.length > 0) { javaProfile = profiles[0]; } } else if (jreLocation.isFile()) javaProfile = jreLocation; else // jreLocation file does not exist throw new IllegalArgumentException(NLS.bind(Messages.exception_nonExistingJreLocationFile, jreLocation.getAbsolutePath())); profileProperties = loadProfile(javaProfile); } if (profileProperties == null) { String profileFile = (environment != null ? environment : DEFAULT_PROFILE).replace('/', '_') + ".profile"; //$NON-NLS-1$ URL profileURL = getResouceFromSystemBundle(profileFile); profileProperties = loadProfile(profileURL); } }
private void initialize(IPublisherInfo publisherInfo) { this.info = publisherInfo; if (jreLocation != null) { File javaProfile = null; if (jreLocation.isDirectory()) { //Look for a JRE profile file to set version and capabilities File[] profiles = jreLocation.listFiles((FileFilter) pathname -> pathname.getAbsolutePath().endsWith(".profile")); //$NON-NLS-1$ if (profiles != null && profiles.length > 0) { javaProfile = profiles[0]; } } else if (jreLocation.isFile()) javaProfile = jreLocation; else // jreLocation file does not exist throw new IllegalArgumentException(NLS.bind(Messages.exception_nonExistingJreLocationFile, jreLocation.getAbsolutePath())); profileProperties = loadProfile(javaProfile); } if (profileProperties == null) { String profileFile = (environment != null ? environment : DEFAULT_PROFILE).replace('/', '_') + ".profile"; //$NON-NLS-1$ URL profileURL = getResouceFromSystemBundle(profileFile); profileProperties = loadProfile(profileURL); } }
private void initialize(IPublisherInfo publisherInfo) { this.info = publisherInfo; if (jreLocation != null) { File javaProfile = null; if (jreLocation.isDirectory()) { //Look for a JRE profile file to set version and capabilities File[] profiles = jreLocation.listFiles(new FileFilter() { public boolean accept(File pathname) { return pathname.getAbsolutePath().endsWith(".profile"); //$NON-NLS-1$ } }); if (profiles != null && profiles.length > 0) { javaProfile = profiles[0]; } } else if (jreLocation.isFile()) javaProfile = jreLocation; else // jreLocation file does not exist throw new IllegalArgumentException(NLS.bind(Messages.exception_nonExistingJreLocationFile, jreLocation.getAbsolutePath())); profileProperties = loadProfile(javaProfile); } if (profileProperties == null) { String profileFile = (environment != null ? environment : DEFAULT_PROFILE).replace('/', '_') + ".profile"; //$NON-NLS-1$ URL profileURL = getResouceFromSystemBundle(profileFile); profileProperties = loadProfile(profileURL); } }
private void initialize(IPublisherInfo publisherInfo) { this.info = publisherInfo; if (jreLocation != null) { File javaProfile = null; if (jreLocation.isDirectory()) { //Look for a JRE profile file to set version and capabilities File[] profiles = jreLocation.listFiles(new FileFilter() { public boolean accept(File pathname) { return pathname.getAbsolutePath().endsWith(".profile"); //$NON-NLS-1$ } }); if (profiles != null && profiles.length > 0) { javaProfile = profiles[0]; } } else if (jreLocation.isFile()) javaProfile = jreLocation; else // jreLocation file does not exist throw new IllegalArgumentException(NLS.bind(Messages.exception_nonExistingJreLocationFile, jreLocation.getAbsolutePath())); profileProperties = loadProfile(javaProfile); } if (profileProperties == null) { String entry = environment != null ? "/profiles/" + environment.replace('/', '_') + ".profile" : DEFAULT_PROFILE; //$NON-NLS-1$ //$NON-NLS-2$ URL profileURL = Activator.getContext().getBundle().getEntry(entry); profileProperties = loadProfile(profileURL); } }