Package com.itstherules.stream.model

Examples of com.itstherules.stream.model.DirectoriesModel


  }
 
  @Override
  public void show(Map<String, Object> parameters, HttpServletResponse response) throws IOException {
    String fileName = (String) parameters.get("fileName");
    parameters.put("mp3", new Mp3(new File(new DirectoriesModel("music").getDirectoryPath() + fileName)));
    merge("mp3/show.freemarker", parameters, response.getWriter());
  }
View Full Code Here


  }
 
  @Override
  public void edit(Map<String, Object> parameters, HttpServletResponse response) throws IOException {
    String fileName = (String) parameters.get("fileName");
    parameters.put("mp3", new Mp3(new File(new DirectoriesModel("music").getDirectoryPath()+fileName)));
    parameters.put("genres", new Mp3Genres().asList());
    merge("mp3/edit.freemarker", parameters, response.getWriter());
  }
View Full Code Here

  }
 
  @Override
  public void update(Map<String, Object> parameters, HttpServletResponse response) throws IOException {
    ParameterBasedMp3 parameterBasedMp3 = new ParameterBasedMp3(parameters);
    parameterBasedMp3.persist(new DirectoriesModel("music").getDirectoryPath());
    response.sendRedirect("../show/index.html?fileName="+parameters.get("full"));
  }
View Full Code Here

  public void generateThumbnails(Map<String, Object> parameters, Writer writer) {
    String baseDirectory = "photos/";
    String extensions = ".jpg,.JPG,.jpeg,.JPEG,.png,.PNG";
    String currentDirectory = (String) parameters.get("directory");
    String thumbnailsDirectoryPath = currentDirectory + "/thumbnails/";
    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);
View Full Code Here

    this.extensions = extensions;
  }

  public List<File> values() {
    try {
      return values(new DirectoriesModel(baseDirectory).getDirectory());
    } catch (FileNotFoundException e) {
    }
    return new LinkedList<File>();
  }
View Full Code Here

  public DirectoriesList(String directory) {
    this.directory = directory;
  }

  public List<File> values(){
    return new DirectoriesModel(directory).asList();
  }
View Full Code Here

TOP

Related Classes of com.itstherules.stream.model.DirectoriesModel

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.