Package com.itstherules.stream.model

Examples of com.itstherules.stream.model.ItemsModel.asList()


    return itemPath(directory, item);
  }

  private File itemPath(String subDirectory, String item) {
    ItemsModel items = new ItemsModel(MOVIES, subDirectory, Extension.flv.toString());
    for (File file : items.asList()) {
      if (item.equals(file.getName())) {
        return file;
      }
    }
    throw new RuntimeException();
View Full Code Here


    File thumbnailsDirectory = new DirectoriesModel(baseDirectory+thumbnailsDirectoryPath).getDirectory();
    ItemsModel imagesModel = new ItemsModel(baseDirectory, currentDirectory, extensions);
    if(!thumbnailsDirectory.exists()) {
      thumbnailsDirectory.mkdir();
    }
    generateThumbnails(thumbnailsDirectory.getAbsolutePath()+"/", imagesModel.asList(), writer, currentDirectory);
  }

  private void generateThumbnails(String thumbnailsDirectory, List<File> files, Writer writer, String currentDirectory) {
    File thumbsDirFile = new File(thumbnailsDirectory);
    for (File file : files) {
View Full Code Here

public class MovieController extends BaseController {
  @Override
  public void list(Map<String, Object> parameters, HttpServletResponse response) throws IOException {
    ItemsModel itemsModel = new ItemsModel("movies", (String) parameters.get("directory"), Extension.flv.toString());
    parameters.put("items", itemsModel.asList());
    merge("movies/list.freemarker", parameters, response.getWriter());
  }
 
  @Override
  public void show(Map<String, Object> parameters, HttpServletResponse response) throws IOException {
View Full Code Here

    this.subDirectory = subDirectory;
  }
 
  public File value(String item) {
    ItemsModel items = new ItemsModel(directory, subDirectory, extension(item));
    for (File file : items.asList()) {
      if (item.equals(file.getName())) {
        return file;
      }
    }
    throw new RuntimeException();
View Full Code Here

  private static final String EXTENSIONS = ".jpg,.jpeg,.png";

  @Override
  public void list(Map<String, Object> parameters, HttpServletResponse response) throws IOException {
    ItemsModel itemsModel = new ItemsModel("photos", (String) parameters.get("directory"), EXTENSIONS);
    parameters.put("items", itemsModel.asList());
    merge("photos/list.freemarker", parameters, response.getWriter());
  }
 
 
  @Override
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.