public String getWorkingDirectory() { return muleConfiguration.getWorkingDirectory(); }
public String getWorkDir() { return muleContext.getConfiguration().getWorkingDirectory(); }
private void moveToCorruptedFilesFolder(File file) throws IOException { String workingDirectory = (new File(muleContext.getConfiguration().getWorkingDirectory())) .toPath().normalize().toString(); String diffFolder = file.getAbsolutePath().split(workingDirectory)[1]; File corruptedFile = new File(muleContext.getConfiguration().getWorkingDirectory() + File.separator + CORRUPTED_FOLDER + diffFolder); moveFileToDirectory(file, corruptedFile.getParentFile(), true); }
private void initObjectStoreDirectory() { if (storeDirectory == null) { String workingDirectory = muleContext.getConfiguration().getWorkingDirectory(); String path = workingDirectory + File.separator + OBJECT_STORE_DIR; storeDirectory = FileUtils.newFile(path); if (!storeDirectory.exists()) { createStoreDirectory(storeDirectory); } } }
props.put("mule.working.dir", muleContext.getConfiguration().getWorkingDirectory());
private void initStoreDirectory() throws ObjectStoreException { try { String workingDirectory = muleContext.getConfiguration().getWorkingDirectory(); String path = workingDirectory + File.separator + DEFAULT_QUEUE_STORE; storeDirectory = FileUtils.newFile(path); } catch (MuleRuntimeException mre) { // FileUtils throws a MuleRuntimeException if something goes wrong when // creating the // path. To fully conform to the ObjectStore contract we cannot just let // it bubble // through but rather catch it and re-throw as ObjectStoreException throw new ObjectStoreException(mre); } }
final String muleInternalDir = config.getWorkingDirectory(); String objectStoreDir = properties.get(PROPERTY_OBJECTSTORE_DIR);
@Override public void initialise() throws InitialisationException { super.initialise(); if (encoding == null) { encoding = context.getConfiguration().getDefaultEncoding(); } if (directory == null) { directory = context.getConfiguration().getWorkingDirectory() + "/objectstore"; } try { File dir = FileUtils.openDirectory(directory); fileStore = new File(dir, name + ".dat"); if (fileStore.exists()) { loadFromStore(); } } catch (Exception e) { throw new InitialisationException(e, this); } }
return getMuleContext().getConfiguration().getWorkingDirectory();
@Override public ContextHandler createContextHandler(App app) throws Exception { WebAppContext webAppContext = (WebAppContext) super.createContextHandler(app); if (webappsConfiguration.getServerClasses() != null) { webAppContext.setServerClasses(webappsConfiguration.getServerClasses()); } if (webappsConfiguration.getSystemClasses() != null) { webAppContext.setSystemClasses(webappsConfiguration.getSystemClasses()); } File workDir = new File(muleContext.getConfiguration().getWorkingDirectory(), "_exploded_wars" + webAppContext.getContextPath()); workDir.mkdirs(); webAppContext.setTempDirectory(workDir); webAppContext.setAttribute(MULE_CONTEXT_ATTRIBUTE, muleContext); webAppContext.setVirtualHosts(new String[] {getVirtualHostName(jettyConnector)}); if (logger.isInfoEnabled()) { String msg = String.format("Will deploy a web app at %s://%s%s%s", "http", jettyConnector.getHost(), jettyConnector.getPort() == 80 ? StringUtils.EMPTY : ":" + jettyConnector.getPort(), webAppContext.getContextPath()); logger.info(StringMessageUtils.getBoilerPlate(msg, '*', 70)); } return webAppContext; } };
private void setConfigAndDelegate(QueueConfiguration newConfig) { if (delegate != null) { return; } this.config = newConfig; if (this.config == null) { this.config = new DefaultQueueConfiguration(); } if (this.config.isPersistent()) { delegate = new DualRandomAccessFileQueueStoreDelegate(this.name, muleContext.getConfiguration().getWorkingDirectory(), muleContext, this.config.getCapacity()); } else { delegate = new DefaultQueueStoreDelegate(this.config.getCapacity()); } }
@Override public void initialise() throws InitialisationException { String workingDirectory = getMuleContext().getConfiguration().getWorkingDirectory(); int queueTransactionFilesSizeInMegabytes = getMuleContext().getConfiguration().getMaxQueueTransactionFilesSizeInMegabytes(); localTxTransactionJournal = new LocalTxQueueTransactionJournal(workingDirectory + File.separator + "queue-tx-log", getMuleContext(), queueTransactionFilesSizeInMegabytes); localTxQueueTransactionRecoverer = new LocalTxQueueTransactionRecoverer(localTxTransactionJournal, this); xaTransactionJournal = new XaTxQueueTransactionJournal(workingDirectory + File.separator + "queue-xa-tx-log", getMuleContext(), queueTransactionFilesSizeInMegabytes); xaTransactionRecoverer = new XaTransactionRecoverer(xaTransactionJournal, this); }