Monday, February 21, 2022

Other Utilities

File checker


public interface AbcFileValidationService {
  boolean isFileExists(@NotBlank String absolutePathToFile);
}

@ValidatedService
public class AbcFileValidationServiceImpl implements AbcFileValidationService {

  @Override
  public boolean isFileExists(@NotBlank final String absolutePathToFile) {
    final FileSystemResource fileResource = new FileSystemResource(absolutePathToFile);
    return fileResource.exists();
  }
}

No comments:

Post a Comment