/** * Initialize the repository Subclasses should first call this method and * then if it returns true, do their own initialization * * @return true if initialized, false if already had been initialized. * @throws Exception */ protected boolean init() throws Exception { if (inited) return false; inited = true; if (reporter == null) { ReporterAdapter reporter = trace ? new ReporterAdapter(System.out) : new ReporterAdapter(); reporter.setTrace(trace); reporter.setExceptions(trace); this.reporter = reporter; } if (!root.isDirectory()) { root.mkdirs(); if (!root.isDirectory()) throw new IllegalArgumentException("Location cannot be turned into a directory " + root); exec(init, root.getAbsolutePath()); } open(); return true; }
/** * Initialize the repository Subclasses should first call this method and * then if it returns true, do their own initialization * * @return true if initialized, false if already had been initialized. * @throws Exception */ protected boolean init() throws Exception { if (inited) return false; inited = true; if (reporter == null) { ReporterAdapter reporter = trace ? new ReporterAdapter(System.out) : new ReporterAdapter(); reporter.setTrace(trace); reporter.setExceptions(trace); this.reporter = reporter; } reporter.trace("init"); if (!root.isDirectory()) { root.mkdirs(); if (!root.isDirectory()) throw new IllegalArgumentException("Location cannot be turned into a directory " + root); exec(init, root.getAbsolutePath()); } if (hasIndex) index = new PersistentMap<ResourceDescriptor>(new File(root, ".index"), ResourceDescriptor.class); open(); return true; }
/** * Initialize the repository Subclasses should first call this method and * then if it returns true, do their own initialization * * @return true if initialized, false if already had been initialized. * @throws Exception */ protected boolean init() throws Exception { if (inited) return false; inited = true; if (reporter == null) { ReporterAdapter reporter = trace ? new ReporterAdapter(System.out) : new ReporterAdapter(); reporter.setTrace(trace); reporter.setExceptions(trace); this.reporter = reporter; } reporter.trace("init"); if (!root.isDirectory()) { root.mkdirs(); if (!root.isDirectory()) throw new IllegalArgumentException("Location cannot be turned into a directory " + root); exec(init, root.getAbsolutePath()); } if (hasIndex) index = new PersistentMap<ResourceDescriptor>(new File(root, ".index"), ResourceDescriptor.class); open(); return true; }
/** * Initialize the repository Subclasses should first call this method and * then if it returns true, do their own initialization * * @return true if initialized, false if already had been initialized. * @throws Exception */ protected boolean init() throws Exception { if (inited) return false; inited = true; if (reporter == null) { ReporterAdapter reporter = trace ? new ReporterAdapter(System.out) : new ReporterAdapter(); reporter.setTrace(trace); reporter.setExceptions(trace); this.reporter = reporter; } logger.debug("init"); if (!root.isDirectory()) { IO.mkdirs(root); if (!root.isDirectory()) throw new IllegalArgumentException("Location cannot be turned into a directory " + root); exec(init, IO.absolutePath(root)); } if (hasIndex) index = new PersistentMap<>(new File(root, ".index"), ResourceDescriptor.class); open(); return true; }
/** * Initialize the repository Subclasses should first call this method and * then if it returns true, do their own initialization * * @return true if initialized, false if already had been initialized. * @throws Exception */ protected boolean init() throws Exception { if (inited) return false; inited = true; if (reporter == null) { ReporterAdapter reporter = trace ? new ReporterAdapter(System.out) : new ReporterAdapter(); reporter.setTrace(trace); reporter.setExceptions(trace); this.reporter = reporter; } logger.debug("init"); if (!root.isDirectory()) { IO.mkdirs(root); if (!root.isDirectory()) throw new IllegalArgumentException("Location cannot be turned into a directory " + root); exec(init, IO.absolutePath(root)); } if (hasIndex) index = new PersistentMap<>(new File(root, ".index"), ResourceDescriptor.class); open(); return true; }