public void setLocale(Locale locale) { this.locale = locale == null ? Locale.getDefault() : locale; try { this.bundle = ResourceBundleFactory.getBundle(this.locale); } catch (MissingResourceException e) { System.out.println( "Missing resource : " + Main.bundleName.replace('.', '/') + ".properties for locale " + locale); //$NON-NLS-1$//$NON-NLS-2$ throw e; } }
public EclipseFileManager(Locale locale, Charset charset) { this.locale = locale == null ? Locale.getDefault() : locale; this.charset = charset == null ? Charset.defaultCharset() : charset; this.locations = new HashMap<>(); this.archivesCache = new HashMap<>(); try { this.setLocation(StandardLocation.PLATFORM_CLASS_PATH, getDefaultBootclasspath()); Iterable<? extends File> defaultClasspath = getDefaultClasspath(); this.setLocation(StandardLocation.CLASS_PATH, defaultClasspath); this.setLocation(StandardLocation.ANNOTATION_PROCESSOR_PATH, defaultClasspath); } catch (IOException e) { // ignore } try { this.bundle = ResourceBundleFactory.getBundle(this.locale); } catch (MissingResourceException e) { System.out.println( "Missing resource : " + Main.bundleName.replace('.', '/') + ".properties for locale " + locale); //$NON-NLS-1$//$NON-NLS-2$ } }