Package org.myphotodiary.util

Examples of org.myphotodiary.util.DirectoryIndexer


      File[] images = dir.listFiles(new FilesFilter(cfg.imgExtensions));
      if ((images.length > 0) && (cfg.isAutoIndexing)) {
        // Automatic indexing of images
        // Check if all images of current directory are indexed
        // (Indexing is necessary to enable image queries based on directory attributes).
        new DirectoryIndexer().indexDirectory(path, false);
      }
      Arrays.sort(images);
      int ix = 0;
      for (File image: images) {
        jsonObject += "{\"url\":\"" + cfg.imageRootUrl + path + "/" + image.getName() + "\"}";
View Full Code Here


    try {
      // RBAC
      AccessController.checkAuthorization(path, request, Action.browse, null);

      // Get the list of thumbnail files
      File[] thumbnails = new DirectoryIndexer().checkAndUpdateThumbnails(path);

      if ((thumbnails != null) && (thumbnails.length > 0)) {
        int ix = 0;
        for (File thumbnail: thumbnails) {
          jsonObject += "{\"url\":\"" + cfg.getImageRootUrl(request) + path + "/" + Configuration.thumbDirName + "/" + thumbnail.getName() + "\"}";
View Full Code Here

      try {
        // Apply access control rules
        AccessController.checkAuthorization(path, request, Action.browse, null);
       
        // refresh the list of reduced images for the web
        new DirectoryIndexer().checkAndUpdateWebImg(path);

        File[] images = dir.listFiles(new FilesFilter(cfg.imgExtensions));
        if ((images.length > 0) && (cfg.isAutoIndexing)) {
          // Automatic indexing of images
          // Check if all images of current directory are indexed
          // (Indexing is necessary to enable image queries based on directory attributes).
          new DirectoryIndexer().indexDirectory(path, false, request);
        }
        Arrays.sort(images);
        int ix = 0;
        for (File image: images) {
          jsonObject += "{\"url\":\"" + cfg.getImageRootUrl(request) + path + "/" + Configuration.webImgDirName + "/"+ image.getName() + "\"}";
View Full Code Here

    }
    getServletContext().log("Process administrative command: " + cmd.getCmd() + "(" + Arrays.toString(cmd.getParams())+")");

    for (String dirPath: cmd.getParams()) {
      try {
        DirectoryIndexer indexer = new DirectoryIndexer();
        if (cmd.getCmd().equals(Configuration.indexCmd)) {
          // force indexing
          indexer.indexDirectory(dirPath, true, request);
          // Complete thumbnails and web images if necessary
          indexer.checkAndUpdateThumbnails(dirPath);
          indexer.checkAndUpdateWebImg(dirPath);
        }
        else if (cmd.getCmd().equals(Configuration.resetIndexCmd)) {
          // delete directory index
          indexer.deleteDirectoryIndex(dirPath, request);
        }
        else if (cmd.getCmd().equals(Configuration.deleteCmd)) {
          // delete directory index and images
          indexer.deleteDirectoryIndexAndImages(dirPath, request);
        }
      } catch (AuthenticationException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      } catch (AuthorizationException e) {
View Full Code Here

   
    for (String dirPath: cmd.getParams()) {
      try {
        if (cmd.getCmd().equals(Configuration.indexCmd)) {
          // force indexing
          new DirectoryIndexer().indexDirectory(dirPath, true, request);
        }
        else if (cmd.getCmd().equals(Configuration.resetIndexCmd)) {
          // delete directory index
          new DirectoryIndexer().deleteDirectoryIndex(dirPath, request);
        }
        else if (cmd.getCmd().equals(Configuration.deleteCmd)) {
          // delete directory index and images
          new DirectoryIndexer().deleteDirectoryIndexAndImages(dirPath, request);
        }
      } catch (AuthenticationException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
View Full Code Here

    getServletContext().log("Process administrative command: " + cmd.getCmd() + "(" + Arrays.toString(cmd.getParams())+")");
   
    for (String dirPath: cmd.getParams()) {
      if (cmd.getCmd().equals(Configuration.indexCmd)) {
        // Force indexing, even if not allowed because it is an administrative command
        new DirectoryIndexer().indexDirectory(dirPath, true);
      }
      else if (cmd.getCmd().equals(Configuration.resetIndexCmd)) {
        new DirectoryIndexer().deleteDirectoryIndex(dirPath);
      }
      else if (cmd.getCmd().equals(Configuration.deleteCmd)) {
        new DirectoryIndexer().deleteDirectoryIndexAndImages(dirPath);
      }
    }
    response.setStatus(HttpServletResponse.SC_OK);
    getServletContext().log("<- DirIndexSvr.doPost()");
  }
View Full Code Here

        File[] images = dir.listFiles(new FilesFilter(cfg.imgExtensions));
        if ((images.length > 0) && (cfg.isAutoIndexing)) {
          // Automatic indexing of images
          // Check if all images of current directory are indexed
          // (Indexing is necessary to enable image queries based on directory attributes).
          new DirectoryIndexer().indexDirectory(path, false, request);
        }
        Arrays.sort(images);
        int ix = 0;
        for (File image: images) {
          jsonObject += "{\"url\":\"" + cfg.getImageRootUrl(request) + path + "/" + Configuration.webImgDirName + "/"+ image.getName() + "\"}";
View Full Code Here

TOP

Related Classes of org.myphotodiary.util.DirectoryIndexer

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.