Code example for AtomicLong

Methods: incrementAndGet

0
        static void deleteAll(final File root) {
            File[] filesToDelete = root.listFiles(excludeNonBufferFiles());
            if (filesToDelete != null) {
                for (File file : filesToDelete) {
                    file.delete();
                } 
            } 
        } 
 
        static FilenameFilter excludeBufferFiles() {
            return filterExcludeBufferFiles;
        } 
 
        static FilenameFilter excludeNonBufferFiles() {
            return filterExcludeNonBufferFiles;
        } 
 
        static File newFile(final File root) {
            String name = FILE_NAME_PREFIX + Long.valueOf(bufferIndex.incrementAndGet()).toString();
            return new File(root, name);
        }