Package br.com.jteam.jfcm.model.validator

Examples of br.com.jteam.jfcm.model.validator.FileExtensionValidator.validate()


      if (!FileTypeUtil.isFilePresentOnDisk(path)) {
        throw new ShowFileContentServiceException(
            "File doesn't exist anymore on disc");
      }
      FileExtensionValidator fileExtensionValidator = new ShowFileExtensionValidator();
      fileExtensionValidator.validate(name);
      FileType fileType = FileType.getFileTypeByFileName(name);
      br.com.jteam.jfcm.model.File fileToBeViewed = FileFactory.getInstance(
          fileType).createFile(name, path);
      return fileToBeViewed;
    } catch (IncorrectFileExtensionException ex) {
View Full Code Here


  {
    if (file == null) { throw new IllegalArgumentException("Zip File cannot be null"); }
    if (!FileTypeUtil.isFilePresentOnDisk(file.getAbsolutePath())) { throw new FileListContentServiceException(
      "File doesn't exist anymore on disc"); }
    FileExtensionValidator fileExtensionValidator = new ZipFileExtensionValidator();
    fileExtensionValidator.validate(file.getName());
    FileType fileType = FileType.getFileTypeByFileName(file.getName());
    return FileFactory.getInstance(fileType).createFile(file.getName(), file.getAbsolutePath());
  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.