private LimbusSystem configureLimbusSystem() throws Exception { File confDir = getConfigurationDirectoryUnchecked(); File systemConfig = getOrFailFile("limbus system description", new File(confDir, DEFAULT_SYSTEM_FILENAME)); try (FileInputStream fin = new FileInputStream(systemConfig)) { return fromInputStream(fin); } }
private void addFileInfo(String label, File directory, Panel panel) { String absolutePath = directory.getAbsolutePath(); boolean accessible = false; if (directory.isDirectory()) { accessible = Files.isAccessibleDirectory(directory); } else { accessible = Files.isAccessibleFile(directory); } addInfo(label, absolutePath, toYesNo(accessible), panel); }
public File getCreateOrFailDeployDirectory() throws Exception { checkState(); File deployFolder = getDeployDirectoryUnchecked(); createIfMissingDirectory(deployFolder); return getOrFailDirectory("deploy", deployFolder); }
@Override protected void performInitialize() throws LoggingActivatorException { try { // First try to access the logging.properties in Limbus Engine's conf/ folder. File confDir = getOrFailConfigurationDirectory(); File logConfigOverride = new File(confDir, LOGGING_PROPERTIES); boolean override = isAccessibleFile(logConfigOverride); InputStream logConfig = null; if (override) { // Read from config file if accessible logConfig = new FileInputStream(logConfigOverride); } else { // Read the default logging configuration. logConfig = JDKLoggingActivator.class.getResourceAsStream("/" + LOGGING_PROPERTIES); } initializeJUL(logConfig); } catch (Exception e) { throw new LoggingActivatorException("Cannot initialize Java Utils Logging framework.", e); } }
public static File getUserSettingsFile() throws Exception { return getOrFailFile("user mavens settings", new File(getUserMavenConfigurationHome(), "settings.xml")); }
public static File getUserHome() throws Exception { return getOrFailDirectory("user home", System.getProperty("user.home")); }
@Override public File getDeployDirectoryUnchecked() { checkState(); File deployFolder = new File(getCurrentDirectory(), deployFolder()); return deployFolder; }
/** * @return Returns the list of known deploy names deployed by deploy service. */ @Override public List<String> getDeployedComponents() { checkState(); List<String> deployNames = new LinkedList<>(); try { File workDirectory = getOrFailWorkDirectory(); File[] listFiles = workDirectory.listFiles(); for (File file : listFiles) { if (isAccessibleDirectory(file)) { deployNames.add(file.getName()); } } } catch (Exception e) { log.error("Limbus deploy service cannot access the filesystem.", e); } return deployNames; }
public static File getUserLocalRepository() throws Exception { return getOrFailDirectory("user local maven repository", new File(getUserMavenConfigurationHome(), "repository")); }
@Override public File getWorkDirectoryUnchecked() { checkState(); File folder = new File(getCurrentDirectory(), workFolder()); return folder; }
public File getCreateOrFailWorkDirectory() throws Exception { checkState(); File folder = getWorkDirectoryUnchecked(); createIfMissingDirectory(folder); return getOrFailDirectory("work", folder); }
public static File getUserMavenConfigurationHome() throws Exception { return getOrFailDirectory("maven user config home directory", new File(getUserHome(), ".m2")); }
private File getCreateOrFailPluginDirectory(String deployName) throws Exception { checkState(); File deployDirectory = getPluginDirectoryUnchecked(deployName); try { if (!deployDirectory.exists()) { deployDirectory.mkdir(); } return getOrFailDirectory("plugin", deployDirectory); } catch (Exception e) { throw new LimbusException( String.format("Cannot create plugin deploy folder %s", deployDirectory.getAbsolutePath()), e); } }
public File getOrFailPluginDirectory(String deployName) throws Exception { checkState(); return getOrFailDirectory("plugin", getPluginDirectoryUnchecked(deployName)); }
public File getOrFailWorkDirectory() throws Exception { checkState(); return getOrFailDirectory("work", getWorkDirectoryUnchecked()); }
public File getOrFailDeployDir() throws Exception { checkState(); return getOrFailDirectory("deploy", getDeployDirectoryUnchecked()); }