Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
  • commons-bootstrap/src/main/java/io/onedev/commons/bootstrap/Bootstrap.java
    Content is identical
  • ■ ■ ■ ■ ■ ■
    commons-utils/src/main/java/io/onedev/commons/utils/FileUtils.java
    skipped 201 lines
    202 202   }
    203 203   }
    204 204   
     205 + public static void deleteDir(File dir, int retries) {
     206 + int retried = 0;
     207 + while (dir.exists()) {
     208 + try {
     209 + deleteDir(dir);
     210 + break;
     211 + } catch (Exception e) {
     212 + if (retried++ < retries) {
     213 + logger.error("Error deleting directory '" + dir.getAbsolutePath() + "', will retry later...", e);
     214 + try {
     215 + Thread.sleep(5000);
     216 + } catch (InterruptedException e2) {
     217 + }
     218 + } else {
     219 + throw e;
     220 + }
     221 + }
     222 + }
     223 + }
     224 +
    205 225   public static void deleteFile(File file) {
    206 226   int maxTries = 10;
    207 227   int numTries = 1;
    skipped 44 lines
    252 272   }
    253 273  
    254 274   public static File createTempDir(String prefix) {
    255  - File temp;
    256  - 
    257  - try {
    258  - temp = File.createTempFile(prefix, "");
    259  - } catch (IOException e) {
    260  - throw new RuntimeException(e);
    261  - }
    262  - 
    263  - if (!temp.delete())
    264  - throw new RuntimeException("Could not delete temp file: " + temp.getAbsolutePath());
    265  - 
    266  - if (!temp.mkdirs())
    267  - throw new RuntimeException("Could not create temp directory: " + temp.getAbsolutePath());
    268  - 
    269  - return temp;
     275 + return Bootstrap.createTempDir(prefix);
    270 276   }
    271 277  
    272 278   public static File createTempDir() {
    skipped 311 lines
  • ■ ■ ■ ■
    commons-utils/src/main/java/io/onedev/commons/utils/TaskLogger.java
    skipped 21 lines
    22 22   log(builder.toString());
    23 23   }
    24 24  
    25  - public abstract void log(String message, @Nullable String taskId);
     25 + public abstract void log(String message, @Nullable String sessionId);
    26 26  
    27 27   public void log(String message) {
    28 28   log(message, (String)null);
    skipped 40 lines
Please wait...
Page is in error, reload to recover