Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 23 for deleteIfExists (0.08 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. impl/maven-core/src/main/java/org/apache/maven/internal/transformation/impl/TransformedArtifact.java

            String result;
            ModelSource src = sourcePathProvider.get();
            if (src == null) {
                Files.deleteIfExists(target);
                result = null;
            } else if (!Files.exists(src.getPath())) {
                Files.deleteIfExists(target);
                result = "";
            } else {
                String current = ChecksumAlgorithmHelper.calculate(
    Created: Sun Apr 05 03:35:12 GMT 2026
    - Last Modified: Thu Nov 06 18:32:25 GMT 2025
    - 4.8K bytes
    - Click Count (0)
  5. 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)
  6. 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)
  7. 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)
  8. src/main/java/jcifs/internal/smb2/persistent/PersistentHandleManager.java

            if (info.getType() != HandleType.PERSISTENT) {
                return;
            }
    
            Path handleFile = stateDirectory.resolve(info.getCreateGuid().toString() + ".handle");
            try {
                Files.deleteIfExists(handleFile);
                log.debug("Removed persisted handle file: {}", handleFile);
            } catch (IOException e) {
                log.error("Failed to remove persisted handle file: " + handleFile, e);
            }
    Created: Sun Apr 05 00:10:12 GMT 2026
    - Last Modified: Sun Aug 24 00:49:49 GMT 2025
    - 13K bytes
    - Click Count (0)
  9. impl/maven-core/src/main/java/org/apache/maven/execution/DefaultBuildResumptionDataRepository.java

        @Override
        public void removeResumptionData(MavenProject rootProject) {
            Path resumeProperties = Paths.get(rootProject.getBuild().getDirectory(), RESUME_PROPERTIES_FILENAME);
            try {
                Files.deleteIfExists(resumeProperties);
            } catch (IOException e) {
                LOGGER.warn("Could not delete {} file. ", RESUME_PROPERTIES_FILENAME, e);
            }
        }
    
    Created: Sun Apr 05 03:35:12 GMT 2026
    - Last Modified: Tue Feb 11 16:38:19 GMT 2025
    - 4.9K bytes
    - Click Count (0)
  10. impl/maven-cli/src/test/java/org/apache/maven/cling/invoker/mvnup/goals/CheckTest.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: Sat Jun 07 06:22:47 GMT 2025
    - 4.9K bytes
    - Click Count (0)
Back to Top