org.mule.runtime.core.api.util.FileUtils.createFile()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.3k)|赞(0)|评价(0)|浏览(163)

本文整理了Java中org.mule.runtime.core.api.util.FileUtils.createFile()方法的一些代码示例,展示了FileUtils.createFile()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileUtils.createFile()方法的具体详情如下:
包路径:org.mule.runtime.core.api.util.FileUtils
类名称:FileUtils
方法名:createFile

FileUtils.createFile介绍

暂无

代码示例

代码示例来源:origin: mulesoft/mule

private void putApplicationInTestDomainAppsFolder(String appName) throws IOException {
  File domainDirectory = new File(domainsFolder, DOMAIN_NAME);
  domainDirectory.mkdirs();
  assertThat(FileUtils.createFile(new File(domainsFolder,
                       DOMAIN_NAME + File.separator + DomainArchiveDeployer.DOMAIN_BUNDLE_APPS_FOLDER
                         + File.separator + appName + JAR_FILE_EXTENSION).getAbsolutePath())
    .exists(), is(true));
 }
}

代码示例来源:origin: mulesoft/mule

/**
 * Creates the pom file for a deployable artifact inside the artifact exploded folder
 *
 * @param artifactFolder the deployable artifact folder
 * @param model the pom model
 */
public static void createDeployablePomFile(File artifactFolder, Model model) {
 File pomFileLocation =
   new File(artifactFolder, Paths.get("META-INF", "maven", model.getGroupId(), model.getArtifactId(), "pom.xml").toString());
 try {
  createFile(pomFileLocation.getAbsolutePath());
 } catch (IOException e) {
  throw new MuleRuntimeException(e);
 }
 try (FileWriter fileWriter = new FileWriter(pomFileLocation)) {
  new MavenXpp3Writer().write(fileWriter, model);
 } catch (IOException e) {
  throw new MuleRuntimeException(e);
 }
}

代码示例来源:origin: mulesoft/mule

private File createDomainResource(String domainName, String resourceFile) throws Exception {
 final File file = new File(getDomainFolder(domainName), resourceFile);
 assertThat(FileUtils.createFile(file.getAbsolutePath()).exists(), is(true));
 return file;
}

代码示例来源:origin: mulesoft/mule

@Test
public void loadAFileNonZipFile() throws IOException {
 expectedException.expect(IllegalArgumentException.class);
 File nonZipFile = createFile(new File(pluginsFolder.getRoot(), "test").getAbsolutePath());
 pluginDescriptorLoader.load(nonZipFile);
}

代码示例来源:origin: mulesoft/mule

assertTrue(file.exists());
file = FileUtils.createFile(TEST_FILE);
assertNotNull(file);
assertTrue(file.exists());
file = FileUtils.createFile(TEST_FILE + "2");
assertNotNull(file);
assertTrue(file.exists());

代码示例来源:origin: org.mule.runtime/mule-core

public static synchronized File stringToFile(String filename, String data, boolean append, boolean newLine) throws IOException {
 File f = createFile(filename);
 BufferedWriter writer = null;
 try {
  writer = new BufferedWriter(new FileWriter(f, append));
  writer.write(data);
  if (newLine) {
   writer.newLine();
  }
 } finally {
  if (writer != null) {
   writer.close();
  }
 }
 return f;
}

代码示例来源:origin: org.mule.runtime/mule-core

/**
  * Creates a file corresponding to the fist enqueued object in a given queue
  *
  * @param workingFolder container's working folder.
  * @param queueName name of the queue where the object is added.
  * @return the file corresponding to the enqueued object
  * @throws IOException if there is any problem creating the file.
  */
 public static File getFirstQueueFileForTesting(File workingFolder, String queueName) throws IOException {
  File firstQueueFile = DualRandomAccessFileQueueStoreDelegate
    .getFirstQueueFileForTesting(queueName, workingFolder.getAbsolutePath());
  return FileUtils.createFile(firstQueueFile.getAbsolutePath());
 }
}

代码示例来源:origin: org.mule.runtime/mule-core

fis = new FileInputStream(sourceFile);
if (!destinationFile.exists()) {
 FileUtils.createFile(destinationFile.getPath());

代码示例来源:origin: org.mule.runtime/mule-module-deployment

private void putApplicationInTestDomainAppsFolder(String appName) throws IOException {
  File domainDirectory = new File(domainsFolder, DOMAIN_NAME);
  domainDirectory.mkdirs();
  assertThat(FileUtils.createFile(new File(domainsFolder,
                       DOMAIN_NAME + File.separator + DomainArchiveDeployer.DOMAIN_BUNDLE_APPS_FOLDER
                         + File.separator + appName + JAR_FILE_EXTENSION).getAbsolutePath())
    .exists(), is(true));
 }
}

代码示例来源:origin: org.mule.runtime/mule-module-deployment-model-impl

/**
 * Creates the pom file for a deployable artifact inside the artifact exploded folder
 *
 * @param artifactFolder the deployable artifact folder
 * @param model the pom model
 */
public static void createDeployablePomFile(File artifactFolder, Model model) {
 File pomFileLocation =
   new File(artifactFolder, Paths.get("META-INF", "maven", model.getGroupId(), model.getArtifactId(), "pom.xml").toString());
 try {
  createFile(pomFileLocation.getAbsolutePath());
 } catch (IOException e) {
  throw new MuleRuntimeException(e);
 }
 try (FileWriter fileWriter = new FileWriter(pomFileLocation)) {
  new MavenXpp3Writer().write(fileWriter, model);
 } catch (IOException e) {
  throw new MuleRuntimeException(e);
 }
}

代码示例来源:origin: org.mule.runtime/mule-module-deployment-model

private File createDomainResource(String domainName, String resourceFile) throws Exception {
 final File file = new File(getDomainFolder(domainName), resourceFile);
 assertThat(FileUtils.createFile(file.getAbsolutePath()).exists(), is(true));
 return file;
}

代码示例来源:origin: org.mule.runtime/mule-module-deployment-model-impl

@Test
public void loadAFileNonZipFile() throws IOException {
 expectedException.expect(IllegalArgumentException.class);
 File nonZipFile = createFile(new File(pluginsFolder.getRoot(), "test").getAbsolutePath());
 pluginDescriptorLoader.load(nonZipFile);
}

代码示例来源:origin: org.mule.runtime/mule-core-tests

assertTrue(file.exists());
file = FileUtils.createFile(TEST_FILE);
assertNotNull(file);
assertTrue(file.exists());
file = FileUtils.createFile(TEST_FILE + "2");
assertNotNull(file);
assertTrue(file.exists());

相关文章