| | |
| | | File[] files = fileNamingPolicy.listFiles(); |
| | | if(files == null) |
| | | { |
| | | LocalizableMessage message = |
| | | ERR_LOGGER_ERROR_LISTING_FILES.get( |
| | | fileNamingPolicy.getInitialName().toString()); |
| | | throw new DirectoryException(DirectoryServer.getServerErrorResultCode(), |
| | | message); |
| | | ERR_LOGGER_ERROR_LISTING_FILES.get(fileNamingPolicy.getInitialName())); |
| | | } |
| | | |
| | | List<File> filesToDelete = new ArrayList<File>(); |
| | | |
| | | if(files.length <= 0) |
| | | { |
| | | return new File[0]; |
| | |
| | | // Sort files based on last modified time. |
| | | Arrays.sort(files, new FileComparator()); |
| | | |
| | | List<File> filesToDelete = new ArrayList<File>(); |
| | | long freedSpace = 0; |
| | | for (int j = files.length - 1; j < 1; j--) |
| | | { |
| | |
| | | break; |
| | | } |
| | | } |
| | | |
| | | return filesToDelete.toArray(new File[filesToDelete.size()]); |
| | | } |
| | | |