Examples of FileDAO


Examples of com.baasbox.dao.FileDao

    }
   
    public static String getExtractedContent(String id) throws SqlInjectionException, InvalidModelException, FileNotFoundException {
      ODocument file = getById(id);
      if (file==null) throw new  FileNotFoundException();
      FileDao dao = FileDao.getInstance();
      String ret=dao.getExtractedContent(file);
      return ret;
    }
View Full Code Here

Examples of com.baasbox.dao.FileDao

    public static ImmutableMap data() throws SqlInjectionException, InvalidCollectionException{
      if (Logger.isTraceEnabled()) Logger.trace("Method Start");
      UserDao userDao = UserDao.getInstance();
      CollectionDao collDao = CollectionDao.getInstance();
      AssetDao assetDao = AssetDao.getInstance();
      FileDao fileDao = FileDao.getInstance();
      ODatabaseRecordTx db = DbHelper.getConnection();
     
      long usersCount =userDao.getCount();
      long assetsCount = assetDao.getCount();
      long collectionsCount = collDao.getCount();
      long filesCount = fileDao.getCount();
     
      List<ODocument> collections = collDao.get(QueryParams.getInstance());
      ArrayList<ImmutableMap> collMap = collectionsDetails(collections);
      ImmutableMap response = ImmutableMap.of(
          "users", usersCount,
View Full Code Here

Examples of fi.foyt.hibernate.gae.search.persistence.dao.FileDAO

  @Override
  public final String[] listAll() {
    ensureOpen();
   
    FileDAO fileDAO = new FileDAO();
    List<File> files = fileDAO.listByDirectory(getDirectory());
    String[] result = new String[files.size()];
       
    int i = 0;
    for (File file : files) {
      result[i++] = file.getName();
View Full Code Here

Examples of fi.foyt.hibernate.gae.search.persistence.dao.FileDAO

  }

  @Override
  public final boolean fileExists(String name) {
    ensureOpen();
    FileDAO fileDAO = new FileDAO();
    File file = fileDAO.findByDirectoryAndName(getDirectory(), name);
    return file != null;
  }
View Full Code Here

Examples of fi.foyt.hibernate.gae.search.persistence.dao.FileDAO

   * @throws IOException if the file does not exist
   */
  @Override
  public final long fileModified(String name) throws IOException {
    ensureOpen();
    FileDAO fileDAO = new FileDAO();
    File file = fileDAO.findByDirectoryAndName(getDirectory(), name);
    if (file == null)
      throw new FileNotFoundException();
   
    return file.getModified();
  }
View Full Code Here

Examples of fi.foyt.hibernate.gae.search.persistence.dao.FileDAO

   * @throws IOException if the file does not exist
   */
  @Override
  public final long fileLength(String name) throws IOException {
    ensureOpen();
    FileDAO fileDAO = new FileDAO();
    File file = fileDAO.findByDirectoryAndName(getDirectory(), name);
    if (file == null)
      throw new FileNotFoundException();

    return file.getDataLength();
  }
View Full Code Here

Examples of fi.foyt.hibernate.gae.search.persistence.dao.FileDAO

   */
  @Override
  public void deleteFile(String name) throws IOException {
    ensureOpen();
   
    FileDAO fileDAO = new FileDAO();
    FileSegmentDAO fileSegmentDAO = new FileSegmentDAO();

    File file = fileDAO.findByDirectoryAndName(getDirectory(), name);
    if (file != null) {
      List<FileSegment> segments = fileSegmentDAO.listByFile(file);
      for (FileSegment segment : segments) {
        fileSegmentDAO.delete(segment);
      }
      fileDAO.delete(file);     
      LOG.fine("Deleted search index file " + name + " from directory " + getDirectory().getName());
    } else {
      throw new FileNotFoundException();
    }
  }
View Full Code Here

Examples of fi.foyt.hibernate.gae.search.persistence.dao.FileDAO

   */
  @Override
  public IndexInput openInput(String name) throws IOException {
    ensureOpen();
   
    FileDAO fileDAO = new FileDAO();
    File file = fileDAO.findByDirectoryAndName(getDirectory(), name);
    if ((file == null) || (file.getDataLength() < 1))
      throw new FileNotFoundException(name);

    return new GaeIndexInput(new GaeFile(name, this));
  }
View Full Code Here

Examples of fi.foyt.hibernate.gae.search.persistence.dao.FileDAO

  public synchronized long getLastModified() {
    return getFile().getModified();
  }

  protected synchronized void setLastModified(long lastModified) {
    FileDAO fileDAO = new FileDAO();
    File file = getFile();
    fileDAO.updateModified(file, lastModified);
  }
View Full Code Here

Examples of fi.foyt.hibernate.gae.search.persistence.dao.FileDAO

    File file = getFile();
    fileDAO.updateModified(file, lastModified);
  }
 
  protected synchronized void resetFile() {
    FileDAO fileDAO = new FileDAO();
    FileSegmentDAO fileSegmentDAO = new FileSegmentDAO();

    File file = getFile();
    if (file != null) {
      List<FileSegment> segments = fileSegmentDAO.listByFile(file);
      for (FileSegment segment : segments) {
        fileSegmentDAO.delete(segment);
      }
     
      fileDAO.updateDataLength(file, 0l)
    }
  }
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.