Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 16 for deleteIfExists (0.09 seconds)

  1. src/test/java/org/codelibs/fess/thumbnail/impl/HtmlTagBasedGeneratorTest.java

        @Test
        public void test_deleteIfExists_existingFile() throws Exception {
            // Test that Files.deleteIfExists works correctly for existing files
            Path tempFile = Files.createTempFile("toctou_test", ".tmp");
            try {
                assertTrue(Files.exists(tempFile));
    
                boolean deleted = Files.deleteIfExists(tempFile);
    
                assertTrue(deleted);
                assertFalse(Files.exists(tempFile));
    Created: Tue Mar 31 13:07:34 GMT 2026
    - Last Modified: Sun Jan 11 08:43:05 GMT 2026
    - 7.5K bytes
    - Click Count (0)
  2. src/test/java/org/codelibs/fess/thumbnail/impl/CommandGeneratorTest.java

        public void test_atomicDeleteIfExists_existingFile() throws Exception {
            // Test that Files.deleteIfExists deletes existing file atomically
            Path tempFile = Files.createTempFile("toctou_cmd_test", ".tmp");
            try {
                assertTrue(Files.exists(tempFile));
    
                boolean deleted = Files.deleteIfExists(tempFile);
    
                assertTrue(deleted);
                assertFalse(Files.exists(tempFile));
    Created: Tue Mar 31 13:07:34 GMT 2026
    - Last Modified: Fri Mar 13 23:01:26 GMT 2026
    - 27.8K bytes
    - Click Count (0)
  3. src/test/java/org/codelibs/fess/thumbnail/ThumbnailManagerTest.java

            // Test that Files.deleteIfExists works correctly for no-image marker files
            Path noImageFile = Files.createTempFile("noimage_test", ".noimage");
            try {
                assertTrue(Files.exists(noImageFile));
    
                // Atomic delete should succeed
                boolean deleted = Files.deleteIfExists(noImageFile);
    
                assertTrue(deleted);
    Created: Tue Mar 31 13:07:34 GMT 2026
    - Last Modified: Fri Mar 13 23:01:26 GMT 2026
    - 20.4K bytes
    - Click Count (0)
  4. src/test/java/org/codelibs/fess/util/ThreadDumpUtilTest.java

                assertTrue("File should contain content", Files.size(tempFile) > 0);
    
            } finally {
                Files.deleteIfExists(tempFile);
                Files.deleteIfExists(tempDir);
            }
        }
    Created: Tue Mar 31 13:07:34 GMT 2026
    - Last Modified: Fri Mar 13 23:01:26 GMT 2026
    - 15.6K bytes
    - Click Count (0)
  5. okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/cache/DiskLruCache.kt

            }
          } else {
            entry.currentEditor = null
            for (t in 0 until valueCount) {
              fileSystem.deleteIfExists(entry.cleanFiles[t])
              fileSystem.deleteIfExists(entry.dirtyFiles[t])
            }
            i.remove()
          }
        }
      }
    
      /**
       * Creates a new journal that omits redundant information. This replaces the current journal if it
       * exists.
       */
    Created: Fri Apr 03 11:42:14 GMT 2026
    - Last Modified: Tue Jan 27 09:00:39 GMT 2026
    - 34.7K bytes
    - Click Count (0)
  6. src/main/java/org/codelibs/fess/thumbnail/impl/CommandGenerator.java

                    if (executeCommand(thumbnailId, cmdList) != 0) {
                        logger.warn("Failed to execute command for thumbnail ID: {}", thumbnailId);
                        try {
                            Files.deleteIfExists(outputPath2);
                        } catch (final IOException e) {
                            logger.warn("Failed to delete output file: {}", outputFile.getAbsolutePath(), e);
                        }
    Created: Tue Mar 31 13:07:34 GMT 2026
    - Last Modified: Thu Jan 01 12:47:47 GMT 2026
    - 16.6K bytes
    - Click Count (0)
  7. guava-tests/test/com/google/common/io/MoreFilesTest.java

              new SimpleFileVisitor<Path>() {
                @Override
                public FileVisitResult visitFile(Path file, BasicFileAttributes attrs)
                    throws IOException {
                  Files.deleteIfExists(file);
                  return FileVisitResult.CONTINUE;
                }
    
                @Override
                public FileVisitResult postVisitDirectory(Path dir, IOException exc)
                    throws IOException {
    Created: Fri Apr 03 12:43:13 GMT 2026
    - Last Modified: Tue Mar 17 19:26:39 GMT 2026
    - 27.5K bytes
    - Click Count (0)
  8. src/main/java/org/codelibs/fess/helper/ThemeHelper.java

                        Files.delete(f);
                    } catch (final IOException e) {
                        logger.warn("Failed to delete: path={}", f, e);
                    }
                });
                Files.deleteIfExists(dir);
            } catch (final IOException e) {
                logger.warn("Failed to delete: path={}", dir, e);
            }
        }
    
        /**
         * Gets the JAR file path for the given artifact.
         *
    Created: Tue Mar 31 13:07:34 GMT 2026
    - Last Modified: Fri Nov 28 16:29:12 GMT 2025
    - 7.1K bytes
    - Click Count (0)
  9. src/main/java/org/codelibs/curl/io/ContentOutputStream.java

            } finally {
                if (!isInMemory() && !done) {
                    final File file = super.getFile();
                    if (file != null) {
                        try {
                            Files.deleteIfExists(file.toPath());
                        } catch (final IOException e) {
                            // Log the error but don't throw to avoid masking exceptions from the main operation
    Created: Thu Apr 02 15:34:12 GMT 2026
    - Last Modified: Thu Nov 20 13:34:13 GMT 2025
    - 3.9K bytes
    - Click Count (0)
  10. impl/maven-cli/src/test/java/org/apache/maven/cling/invoker/mvnup/goals/ApplyTest.java

                                .sorted(java.util.Comparator.reverseOrder())
                                .forEach(path -> {
                                    try {
                                        Files.deleteIfExists(path);
                                    } catch (Exception e) {
                                        // Ignore cleanup errors
                                    }
                                });
    Created: Sun Apr 05 03:35:12 GMT 2026
    - Last Modified: Tue Nov 18 10:39:17 GMT 2025
    - 4.9K bytes
    - Click Count (0)
Back to Top