protected static String getAppDeploymentDirPath(String cartridge, AxisConfiguration axisConfig) { return axisConfig.getRepository().getPath() + File.separator + cartridge; }
/** * Allows users to resolve the path relative to the root directory. * * @param path a relative path * @return a File for the given path relative to the current repository, or null if no repo */ public File getRealPath(String path) { URL repository = axisConfiguration.getRepository(); if (repository != null) { File repo = new File(repository.getFile()); return new File(repo, path); } return null; }
/** * Allows users to resolve the path relative to the root directory. * * @param path a relative path * @return a File for the given path relative to the current repository, or null if no repo */ public File getRealPath(String path) { URL repository = axisConfiguration.getRepository(); if (repository != null) { File repo = new File(repository.getFile()); return new File(repo, path); } return null; }
/** * Downloads the relevant artifacts from the repository * @param filePath path to the artifacts that should be downloaded, relative to the tenants repository * @return the datahandler corresponding to the artifact that should be downloaded */ public DataHandler downloadArtifact(String filePath) { String resourcePath = getAxisConfig().getRepository().getPath() + filePath; FileDataSource datasource = new FileDataSource(new File(resourcePath)); DataHandler handler = new DataHandler(datasource); return handler; }
private static String getFilePathFromFilename(String fileName) { return new File(EventProcessorUtil.getAxisConfiguration().getRepository().getPath()).getAbsolutePath() + File.separator + EventProcessorConstants.EP_ELE_DIRECTORY + File.separator + fileName; }
/** * Delete BPEL Archive from the BPEL repository of the file system. * * @param bpelPackageName Name of the BPEL package */ private void deleteBpelArchive(String bpelPackageName) { String bpelArchiveLocation = tenantConfigContext.getAxisConfiguration().getRepository(). getPath() + File.separator + BPELConstants.BPEL_REPO_DIRECTORY + File.separator + bpelPackageName + "." + BPELConstants.BPEL_PACKAGE_EXTENSION; log.info("Undeploying BPEL package " + bpelPackageName + ". Deleting BPEL archive " + bpelArchiveLocation + "...."); File bpelArchive = new File(bpelArchiveLocation); if (bpelArchive.exists()) { if (!bpelArchive.delete()) { //For windows bpelArchive.deleteOnExit(); } } else { log.warn("BPEL archive " + bpelArchive.getAbsolutePath() + " not found. This can happen if you delete " + "the BPEL archive from the file system."); } }
public boolean deleteLib(String libPath) throws AxisFault { boolean deletionStatus; File libPathFile = new File(getAxisConfig().getRepository().getPath() + libPath); if (!libPathFile.exists()) { log.error("The file " + libPathFile.getAbsolutePath() + " does not exist"); throw new AxisFault("The file " + libPathFile.getName() + " does not exist"); } else { if (!libPathFile.canWrite()) { log.error("The file " + libPathFile.getAbsolutePath() + " is write protected"); throw new AxisFault("The file " + libPathFile.getName() + " is write protected"); } else { deletionStatus = libPathFile.delete(); getConfigContext().setProperty(RELOAD_REQUIRED, Boolean.TRUE); } } return deletionStatus; }
public ServerData getServerData() throws AxisFault { return new ServerData(ServerConstants.SERVER_NAME, getAxisConfig().getRepository().toString()); }
public ServerData getServerData() throws AxisFault { return new ServerData(ServerConstants.SERVER_NAME, getAxisConfig().getRepository().toString()); }
public DirectoryStructureMetaData getDirectoryStructure() throws JSONException { String repo = getAxisConfig().getRepository().getPath(); File folder = new File(repo); JSONObject obj = new JSONObject(); traverseParent(obj, folder, folder.getName()); obj.put(DIRECTORY_NAME_LABEL, folder.getName()); Boolean reloadRequiredProp = (Boolean) getConfigContext().getProperty(RELOAD_REQUIRED); boolean reloadRequired = (reloadRequiredProp != null) ? reloadRequiredProp : false; return new DirectoryStructureMetaData(obj.toString(), reloadRequired); }
String serviceName, String dsContents) throws DataServiceFault { try { URL repositoryURL = axisConfig.getRepository(); String dataservicesFile = repositoryURL.getPath() + File.separator + DBDeployer.DEPLOYMENT_FOLDER_NAME + File.separator
private void createHumanTaskRepository(ConfigurationContext configCtx) throws DeploymentException { String axisRepoPath = configCtx.getAxisConfiguration().getRepository().getPath(); if (CarbonUtils.isURL(axisRepoPath)) { throw new DeploymentException("URL Repositories are not supported: " + axisRepoPath); } File tenantsRepository = new File(axisRepoPath); File humanTaskRepo = new File(tenantsRepository, HumanTaskConstants.HUMANTASK_REPO_DIRECTORY); if (!humanTaskRepo.exists()) { boolean status = humanTaskRepo.mkdir(); if (!status) { throw new DeploymentException("Failed to create HumanTask repository directory " + humanTaskRepo.getAbsolutePath() + "."); } } } }
public boolean deployService(OMElement element) throws AxisFault { try { if (element == null) { throw new AxisFault("Element is null"); } String fileName = element.getLocalName(); OMNode node = element.getFirstOMChild(); if (node instanceof OMText) { OMText txt = (OMText) node; String repo = getAxisConfig().getRepository().getPath(); DataHandler expectedDH = (DataHandler) txt.getDataHandler(); File serviceDir = new File(repo, "services"); File file = new File(serviceDir, fileName); OutputStream out = new FileOutputStream(file); expectedDH.writeTo(out); out.flush(); out.close(); return true; } else { throw new AxisFault("Invalid Message"); } } catch (IOException e) { throw AxisFault.makeFault(e); } }
File repoFile = new File(getAxisConfig().getRepository().getPath());
String repo = configurationContext.getAxisConfiguration().getRepository().getPath();
configurationContext.getAxisConfiguration().getRepository().getFile()); File analyzerConfigDir = new File(tenantAxis2Repo, MONITOR_CONFIG); if (!analyzerConfigDir.exists()) {
configurationContext.getAxisConfiguration().getRepository().getFile()); File synapseConfigsDir = new File(tenantAxis2Repo, "synapse-configs"); if (!synapseConfigsDir.exists()) {
public boolean deployModule(OMElement element) throws AxisFault { try { if (element == null) { throw new AxisFault("Element null"); } String fileName = element.getLocalName(); OMNode node = element.getFirstOMChild(); if (node instanceof OMText) { OMText txt = (OMText) node; String repo = getAxisConfig().getRepository().getPath(); DataHandler expectedDH = (DataHandler) txt.getDataHandler(); File moduleDir = new File(repo, "modules"); File file = new File(moduleDir, fileName); OutputStream out = new FileOutputStream(file); expectedDH.writeTo(out); out.flush(); out.close(); AxisModule module = DeploymentEngine.buildModule(file, getAxisConfig()); getAxisConfig().addModule(module); return true; } else { throw new AxisFault("Invalid Message"); } } catch (IOException e) { throw AxisFault.makeFault(e); } }
String repoPath = EventProcessorUtil.getAxisConfiguration().getRepository().getPath(); File directory = new File(repoPath); if (!directory.exists()) {
File tenantAxis2Repo = new File(configurationContext.getAxisConfiguration().getRepository().getFile()); File synapseConfigsDir = new File(tenantAxis2Repo, "synapse-configs"); if (!synapseConfigsDir.exists()) {