private static ValueSerializer getValueSerializer() { if( serializer == null ) { serializer = Util.lookupService(ValueSerializer.class); } return serializer; }
private static ObjectSerializer getObjectSerializer() { if( objectSerializer == null ) { objectSerializer = Util.lookupService(ObjectSerializer.class); } return objectSerializer; }
private static IPreferencesService getPreferenceService() { if( preferenceService == null ) { preferenceService = Util.lookupService(IPreferencesService.class); } return preferenceService; }
/** * Create a logger for the given class * * @param clazz * the clazz * @return the logger created */ @SuppressWarnings("null") @NonNull public static Logger createLogger(@NonNull Class<?> clazz) { @Nullable LoggerFactory factory = Util.lookupService(LoggerFactory.class); if(factory == null) { factory = new JUtilLoggerFactory(); } return factory.createLogger(clazz.getName()); } }
@Override @SuppressWarnings("null") public ObservableList<@NonNull ResourceItem> getChildren() { if (this.children == null) { this.children = FXCollections.observableArrayList(); try { this.children .addAll(Files .walk(this.path, 1) .filter(p -> p != this.path) .map(p -> Files.isDirectory(p) ? new DirPathItemImpl( p, this.observe) : new FileItemImpl(p)) .collect(Collectors.toList())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } if (this.observe) { FilesystemService service = Util .lookupService(FilesystemService.class); if (service != null) { this.fsSubscription = service.observePath(this.path, this::handlePathModification); } } } return this.children; }
@Override @SuppressWarnings("null") public ObservableList<@NonNull ResourceItem> getChildren() { if (this.children == null) { this.children = FXCollections.observableArrayList(); try { this.children .addAll(Files .walk(this.path, 1) .filter(p -> p != this.path) .map(p -> Files.isDirectory(p) ? new DirPathItemImpl( p, this.observe) : new FileItemImpl(p)) .collect(Collectors.toList())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } if (this.observe) { FilesystemService service = Util .lookupService(FilesystemService.class); if (service != null) { this.fsSubscription = service.observePath(this.path, this::handlePathModification); } } } return this.children; }