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

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

Best Java code snippets using org.apache.activemq.artemis.utils.FileUtil.deleteDirectory (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

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

@Before
public void setUp() throws Throwable {
 FileUtil.deleteDirectory(serverFolder.getRoot());
 evaluate(serverClassloader, "hqfailovertest/hornetqServer.groovy", serverFolder.getRoot().getAbsolutePath());
}
origin: apache/activemq-artemis

@Before
public void setUp() throws Throwable {
 FileUtil.deleteDirectory(serverFolder.getRoot());
 evaluate(serverClassloader, "hqclienttopologytest/artemisServer.groovy", serverFolder.getRoot().getAbsolutePath());
}
origin: apache/activemq-artemis

@Before
public void beforeTest() throws Throwable {
 FileUtil.deleteDirectory(serverFolder.getRoot());
 serverFolder.getRoot().mkdirs();
 setVariable(senderClassloader, "persistent", false);
 startServer(serverFolder.getRoot(), senderClassloader, "1");
}
origin: apache/activemq-artemis

@Before
public void setUp() throws Throwable {
 FileUtil.deleteDirectory(serverFolder.getRoot());
 setVariable(serverClassloader, "persistent", Boolean.FALSE);
 startServer(serverFolder.getRoot(), serverClassloader, "live");
}
origin: apache/activemq-artemis

public static ActiveMQServer startServer() throws Exception {
 if (server == null) {
   Configuration config = new ConfigurationImpl().addAcceptorConfiguration("netty", "tcp://localhost:61616").setSecurityEnabled(false).addConnectorConfiguration("netty", "tcp://localhost:61616");
   File dataPlace = new File("./target/dataJoram");
   FileUtil.deleteDirectory(dataPlace);
   config.setJournalDirectory(new File(dataPlace, "./journal").getAbsolutePath()).
    setPagingDirectory(new File(dataPlace, "./paging").getAbsolutePath()).
    setLargeMessagesDirectory(new File(dataPlace, "./largemessages").getAbsolutePath()).
    setBindingsDirectory(new File(dataPlace, "./bindings").getAbsolutePath()).setPersistenceEnabled(true);
   // disable server persistence since JORAM tests do not restart server
   server = ActiveMQServers.newActiveMQServer(config, useFiles);
   // set DLA and expiry to avoid spamming the log with warnings
   server.getAddressSettingsRepository().addMatch("#", new AddressSettings().setDeadLetterAddress(SimpleString.toSimpleString("DLA")).setExpiryAddress(SimpleString.toSimpleString("Expiry")));
   server.start();
 }
 return server;
}
org.apache.activemq.artemis.utilsFileUtildeleteDirectory

Popular methods of FileUtil

  • makeExec

Popular in Java

  • Running tasks concurrently on multiple threads
  • setContentView (Activity)
  • getExternalFilesDir (Context)
  • setRequestProperty (URLConnection)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • Notification (javax.management)
  • JComboBox (javax.swing)
  • Best plugins for Eclipse
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