List of usage examples for org.springframework.core.io ClassPathResource isReadable
@Override public boolean isReadable()
From source file:chronos.mbeans.QuartzSchedulerAdapter.java
/** * @param factory//ww w .j ava 2 s. co m * {@link StdSchedulerFactory} * @throws SchedulerException * on exception */ private void createOwnScheduler(final StdSchedulerFactory factory) throws SchedulerException { logger.debug("Creating new Quartz scheduler..."); final ClassPathResource resource = new ClassPathResource("quartz.properties"); if (resource.exists() && resource.isReadable()) { logger.debug("Configuring Quartz from resource: " + resource.getPath()); try { final InputStream is = resource.getInputStream(); try { factory.initialize(is); } finally { is.close(); } } catch (final IOException e) { logger.debug("Exception initializing from resource: " + e.getMessage(), e); } } else { logger.debug("Using minimal default properties"); final Properties props = new Properties(); props.put(PROP_SCHED_INSTANCE_NAME, schedulerInstanceName); props.put(PROP_THREAD_POOL_CLASS, SimpleThreadPool.class.getName()); factory.initialize(props); } }