Tabnine Logo
FileUtil
Code IndexAdd Tabnine to your IDE (free)

How to use
FileUtil
in
org.apache.activemq.artemis.utils

Best Java code snippets using org.apache.activemq.artemis.utils.FileUtil (Showing top 20 results out of 315)

origin: wildfly/wildfly

public static final boolean deleteDirectory(final File directory) {
 if (directory.isDirectory()) {
   String[] files = directory.list();
   int num = 5;
   int attempts = 0;
   while (files == null && (attempts < num)) {
    try {
      Thread.sleep(100);
    } catch (InterruptedException e) {
    }
    files = directory.list();
    attempts++;
   }
   if (files == null) {
    ActiveMQUtilLogger.LOGGER.failedListFilesToCleanup(directory.getAbsolutePath());
   } else {
    for (String file : files) {
      File f = new File(directory, file);
      if (!deleteDirectory(f)) {
       ActiveMQUtilLogger.LOGGER.failedToCleanupFile(f.getAbsolutePath());
      }
    }
   }
 }
 return directory.delete();
}
origin: apache/activemq-artemis

private void makeExec(String path) throws IOException {
 FileUtil.makeExec(new File(directory, path));
}
origin: org.apache.activemq/artemis-cli

private void makeExec(String path) throws IOException {
 FileUtil.makeExec(new File(directory, path));
}
origin: apache/activemq-artemis

@Override
public synchronized void removeFileFactory(SequentialFileFactory fileFactory) throws Exception {
 File directory = fileFactory.getDirectory();
 if (directory.exists()) {
   FileUtil.deleteDirectory(directory);
 }
}
origin: apache/activemq-artemis

FileUtil.makeExec(commandLine);
origin: apache/activemq-artemis

protected static final boolean deleteDirectory(final File directory) {
 return FileUtil.deleteDirectory(directory);
}
origin: apache/activemq-artemis

public static final boolean deleteDirectory(final File directory) {
 if (directory.isDirectory()) {
   String[] files = directory.list();
   int num = 5;
   int attempts = 0;
   while (files == null && (attempts < num)) {
    try {
      Thread.sleep(100);
    } catch (InterruptedException e) {
    }
    files = directory.list();
    attempts++;
   }
   if (files == null) {
    ActiveMQUtilLogger.LOGGER.failedListFilesToCleanup(directory.getAbsolutePath());
   } else {
    for (String file : files) {
      File f = new File(directory, file);
      if (!deleteDirectory(f)) {
       ActiveMQUtilLogger.LOGGER.failedToCleanupFile(f.getAbsolutePath());
      }
    }
   }
 }
 return directory.delete();
}
origin: org.apache.activemq/artemis-commons

public static final boolean deleteDirectory(final File directory) {
 if (directory.isDirectory()) {
   String[] files = directory.list();
   int num = 5;
   int attempts = 0;
   while (files == null && (attempts < num)) {
    try {
      Thread.sleep(100);
    } catch (InterruptedException e) {
    }
    files = directory.list();
    attempts++;
   }
   if (files == null) {
    ActiveMQUtilLogger.LOGGER.failedListFilesToCleanup(directory.getAbsolutePath());
   } else {
    for (String file : files) {
      File f = new File(directory, file);
      if (!deleteDirectory(f)) {
       ActiveMQUtilLogger.LOGGER.failedToCleanupFile(f.getAbsolutePath());
      }
    }
   }
 }
 return directory.delete();
}
origin: apache/activemq-artemis

public static final boolean deleteDirectory(final File directory) {
 if (directory.isDirectory()) {
   String[] files = directory.list();
   int num = 5;
   int attempts = 0;
   while (files == null && (attempts < num)) {
    try {
      Thread.sleep(100);
    } catch (InterruptedException e) {
    }
    files = directory.list();
    attempts++;
   }
   if (files == null) {
    ActiveMQUtilLogger.LOGGER.failedListFilesToCleanup(directory.getAbsolutePath());
   } else {
    for (String file : files) {
      File f = new File(directory, file);
      if (!deleteDirectory(f)) {
       ActiveMQUtilLogger.LOGGER.failedToCleanupFile(f.getAbsolutePath());
      }
    }
   }
 }
 return directory.delete();
}
origin: apache/activemq-artemis

public static final boolean deleteDirectory(final File directory) {
 if (directory.isDirectory()) {
   String[] files = directory.list();
   int num = 5;
   int attempts = 0;
   while (files == null && (attempts < num)) {
    try {
      Thread.sleep(100);
    } catch (InterruptedException e) {
    }
    files = directory.list();
    attempts++;
   }
   if (files == null) {
    ActiveMQUtilLogger.LOGGER.failedListFilesToCleanup(directory.getAbsolutePath());
   } else {
    for (String file : files) {
      File f = new File(directory, file);
      if (!deleteDirectory(f)) {
       ActiveMQUtilLogger.LOGGER.failedToCleanupFile(f.getAbsolutePath());
      }
    }
   }
 }
 return directory.delete();
}
origin: org.apache.activemq/artemis-jms-client-all

public static final boolean deleteDirectory(final File directory) {
 if (directory.isDirectory()) {
   String[] files = directory.list();
   int num = 5;
   int attempts = 0;
   while (files == null && (attempts < num)) {
    try {
      Thread.sleep(100);
    } catch (InterruptedException e) {
    }
    files = directory.list();
    attempts++;
   }
   if (files == null) {
    ActiveMQUtilLogger.LOGGER.failedListFilesToCleanup(directory.getAbsolutePath());
   } else {
    for (String file : files) {
      File f = new File(directory, file);
      if (!deleteDirectory(f)) {
       ActiveMQUtilLogger.LOGGER.failedToCleanupFile(f.getAbsolutePath());
      }
    }
   }
 }
 return directory.delete();
}
origin: org.jboss.eap/wildfly-client-all

public static final boolean deleteDirectory(final File directory) {
 if (directory.isDirectory()) {
   String[] files = directory.list();
   int num = 5;
   int attempts = 0;
   while (files == null && (attempts < num)) {
    try {
      Thread.sleep(100);
    } catch (InterruptedException e) {
    }
    files = directory.list();
    attempts++;
   }
   if (files == null) {
    ActiveMQUtilLogger.LOGGER.failedListFilesToCleanup(directory.getAbsolutePath());
   } else {
    for (String file : files) {
      File f = new File(directory, file);
      if (!deleteDirectory(f)) {
       ActiveMQUtilLogger.LOGGER.failedToCleanupFile(f.getAbsolutePath());
      }
    }
   }
 }
 return directory.delete();
}
origin: apache/activemq-artemis

FileUtil.deleteDirectory(tmpdir);
if (tmpdir.exists()) {
 ActiveMQWebLogger.LOGGER.tmpFileNotDeleted(tmpdir);
origin: org.apache.activemq/artemis-web

public void internalStop() throws Exception {
 server.stop();
 if (webContexts != null) {
   File tmpdir = null;
   for (WebAppContext context : webContexts) {
    tmpdir = context.getTempDirectory();
    if (tmpdir != null && !context.isPersistTempDirectory()) {
      //tmpdir will be removed by deleteOnExit()
      //somehow when broker is stopped and restarted quickly
      //this tmpdir won't get deleted sometimes
      boolean fileDeleted = TimeUtils.waitOnBoolean(false, 5000, tmpdir::exists);
      if (!fileDeleted) {
       //because the execution order of shutdown hooks are
       //not determined, so it's possible that the deleteOnExit
       //is executed after this hook, in that case we force a delete.
       FileUtil.deleteDirectory(tmpdir);
       logger.debug("Force to delete temporary file on shutdown: " + tmpdir.getAbsolutePath());
       if (tmpdir.exists()) {
         ActiveMQWebLogger.LOGGER.tmpFileNotDeleted(tmpdir);
       }
      }
    }
   }
   webContexts.clear();
 }
}
origin: apache/activemq-artemis

@Before
public void setUp() throws Throwable {
 FileUtil.deleteDirectory(serverFolder.getRoot());
}
origin: apache/activemq-artemis

@Before
public void setUp() throws Throwable {
 FileUtil.deleteDirectory(serverFolder.getRoot());
}
origin: apache/activemq-artemis

@Before
public void removeFolder() throws Throwable {
 FileUtil.deleteDirectory(serverFolder.getRoot());
 serverFolder.getRoot().mkdirs();
}
origin: apache/activemq-artemis

@Before
public void removeFolder() throws Throwable {
 FileUtil.deleteDirectory(serverFolder.getRoot());
 serverFolder.getRoot().mkdirs();
}
origin: apache/activemq-artemis

@Before
@Override
public void setUp() throws Throwable {
 FileUtil.deleteDirectory(serverFolder.getRoot());
 serverFolder.getRoot().mkdirs();
 File file = serverFolder.newFile(ActiveMQJMSClient.class.getName() + ".properties");
 FileOutputStream fileOutputStream = new FileOutputStream(file);
 PrintStream stream = new PrintStream(fileOutputStream);
 stream.println("enable1xPrefixes=true");
 stream.close();
 setVariable(serverClassloader, "persistent", Boolean.FALSE);
 startServer(serverFolder.getRoot(), serverClassloader, "live");
}
origin: apache/activemq-artemis

@Before
public void beforeTest() throws Throwable {
 FileUtil.deleteDirectory(serverFolder.getRoot());
 serverFolder.getRoot().mkdirs();
 setVariable(senderClassloader, "persistent", false);
}
org.apache.activemq.artemis.utilsFileUtil

Most used methods

  • deleteDirectory
  • makeExec

Popular in Java

  • Reactive rest calls using spring rest template
  • getSystemService (Context)
  • startActivity (Activity)
  • getApplicationContext (Context)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • Path (java.nio.file)
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • JTable (javax.swing)
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now