Package br.com.jteam.jfcm.model.services.exception

Examples of br.com.jteam.jfcm.model.services.exception.ShowFileContentServiceException


    if (path == null) {
      throw new IllegalArgumentException("File path name cannot be null");
    }
    try {
      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) {
      throw new ShowFileContentServiceException(ex);
    }
  }
View Full Code Here

TOP

Related Classes of br.com.jteam.jfcm.model.services.exception.ShowFileContentServiceException

Copyright © 2018 www.massapicom. 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.