Package br.com.jteam.jfcm.model

Examples of br.com.jteam.jfcm.model.FileType


    try {
      File file =
        showFileContentService.createSpecificFileToBeViewed(
          presentationFile.getName(),
          presentationFile.getPath());
      FileType fileType = FileType.getFileTypeByFileName(file.getName());
      RenderedFileType renderedFileType = RenderedFileType.getRenderedFileType(fileType);
      PresentationFile<?> presentationFileToBeViewed;
      if (renderedFileType == RenderedFileType.TEXT) {
        presentationFileToBeViewed =
          new PresentationFile<String>(presentationFile.getName(), presentationFile
View Full Code Here


*/
class ZipFileView extends FileView {

  @Override
  public String getTypeDescription(File f) {
    FileType fileType = FileType.getFileTypeByFileName(f.getAbsolutePath());
    return (fileType != null && fileType == FileType.ZIP ? BaseBundle
        .getValue("filter.zip.file") : "");
  }
View Full Code Here

  @Override
  public boolean accept(File f) {
    if (f.isDirectory()) {
      return true;
    }
    FileType fileType = FileType.getFileTypeByFileName(f.getAbsolutePath());
    return fileType == FileType.ZIP;
  }
View Full Code Here

        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

    }
  }

  private boolean isImage(String fileName)
  {
    FileType fileType = FileType.getFileTypeByFileName(fileName);
    return fileType == FileType.GIF || fileType == FileType.JPG || fileType == FileType.PNG;
  }
View Full Code Here

    return fileType == FileType.GIF || fileType == FileType.JPG || fileType == FileType.PNG;
  }

  private boolean isText(String fileName)
  {
    FileType fileType = FileType.getFileTypeByFileName(fileName);
    return fileType == FileType.TEXT;
  }
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

Related Classes of br.com.jteam.jfcm.model.FileType

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.