Examples of FileInfo


Examples of org.hyperic.sigar.FileInfo

        }
        return events;
    }

    private long getOffset(FileInfo fileInfo) {
        FileInfo previousFileInfo = fileInfo.getPreviousInfo();

        if (previousFileInfo == null) {
            if (LOG.isDebugEnabled()) {
                LOG.debug(this.logFile + ": first stat");
            }
            return fileInfo.getSize();
        }

        if (fileInfo.getInode() != previousFileInfo.getInode()) {
            if (LOG.isDebugEnabled()) {
                LOG.debug(this.logFile + ": file inode changed");
            }
            return -1;
        }

        if (fileInfo.getSize() < previousFileInfo.getSize()) {
            if (LOG.isDebugEnabled()) {
                LOG.debug(this.logFile + ": file truncated");
            }
            return -1;
        }

        if (LOG.isDebugEnabled()) {
            long diff = fileInfo.getSize() - previousFileInfo.getSize();
            LOG.debug(this.logFile + ": " + diff + " new bytes");
        }

        return previousFileInfo.getSize();
    }
View Full Code Here

Examples of org.iq80.leveldb.impl.Filename.FileInfo

            long previousLogNumber = versions.getPrevLogNumber();
            List<File> filenames = Filename.listFiles(databaseDir);

            List<Long> logs = Lists.newArrayList();
            for (File filename : filenames) {
                FileInfo fileInfo = Filename.parseFileName(filename);

                if (fileInfo != null &&
                        fileInfo.getFileType() == FileType.LOG &&
                        ((fileInfo.getFileNumber() >= minLogNumber) || (fileInfo.getFileNumber() == previousLogNumber))) {
                    logs.add(fileInfo.getFileNumber());
                }
            }

            // Recover in the order in which the logs were generated
            VersionEdit edit = new VersionEdit();
View Full Code Here

Examples of org.jboss.fresh.vfs.FileInfo

      }
    }

    // now we do ...
    while (!oin.isFinished()) {
      FileInfo finf = (FileInfo) oin.readObject();

      boolean ok = false;

      for (int i = 0; i < filters.length; i++) {
        String fld = filters[i].getFieldName();
        log.debug("Field name: " + fld);
        if (fld.equals("type")) {
          ok = filters[i].check(cnv(finf.getFileType()));
          log.debug(finf.getFileName() + "  ok? : " + ok);
          if (!ok) break;
        }
      }

      if (ok) oout.writeObject(finf);
View Full Code Here

Examples of org.jnode.fs.hfsplus.FileInfo

        contentModDate = BigEndian.getUInt32(data, 16);
        attrModDate = BigEndian.getUInt32(data, 20);
        accessDate = BigEndian.getUInt32(data, 24);
        backupDate = BigEndian.getUInt32(data, 28);
        permissions = new HfsPlusBSDInfo(data, 32);
        userInfo = new FileInfo(data, 48);
        datas = new HfsPlusForkData(fileId, true, data, 88);
        resources = new HfsPlusForkData(fileId, false, data, 168);
    }
View Full Code Here

Examples of org.olat.core.commons.modules.bc.FileInfo

        }
       
        si = new SubscriptionInfo(new TitleItem(translator.translate(getNotificationHeaderKey(), new String[]{displayName}), getCssClassIcon() ), null);
        SubscriptionListItem subListItem;
        for (Iterator<FileInfo> it_infos = fInfos.iterator(); it_infos.hasNext();) {
              FileInfo fi = it_infos.next();
              MetaInfo metaInfo = fi.getMetaInfo();
              String filePath = fi.getRelPath();
              if(isLogDebugEnabled()) logDebug("filePath=", filePath);
              String fullUserName = getUserNameFromFilePath(filePath);
             
              Date modDate = fi.getLastModified();
              String desc = translator.translate(getNotificationEntryKey(), new String[] { filePath, fullUserName });
              String urlToSend = NotificationHelper.getURLFromBusinessPathString(p, p.getBusinessPath());
             
              String iconCssClass =  null;
              if (metaInfo != null) {
View Full Code Here

Examples of org.olat.core.commons.modules.bc.FileInfo

        final Translator translator = Util.createPackageTranslator(FolderNotificationsHandler.class, locale);

        si = new SubscriptionInfo(getTitleItem(p, translator), null);
        SubscriptionListItem subListItem;
        for (Iterator<FileInfo> it_infos = fInfos.iterator(); it_infos.hasNext();) {
          FileInfo fi = it_infos.next();
          String title = fi.getRelPath();
          MetaInfo metaInfo = fi.getMetaInfo();
          String iconCssClass =  null;
          if (metaInfo != null) {
            if (metaInfo.getTitle() != null) {
              title += " (" + metaInfo.getTitle() + ")";
            }
            iconCssClass = metaInfo.getIconCssClass();
          }
          Identity ident = fi.getAuthor();
          Date modDate = fi.getLastModified();

          String desc = translator.translate("notifications.entry", new String[] { title, NotificationHelper.getFormatedName(ident) });
          String urlToSend = null;
          if(p.getBusinessPath() != null) {
            urlToSend = NotificationHelper.getURLFromBusinessPathString(p, businessPath + fi.getRelPath() + "]");
          }
          subListItem = new SubscriptionListItem(desc, urlToSend, modDate, iconCssClass);
          si.addSubscriptionListItem(subListItem);
        }
      } else {
View Full Code Here

Examples of org.opentides.bean.FileInfo

   * @see org.springframework.web.servlet.mvc.AbstractController#handleRequestInternal(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
   */
  @Override
  protected ModelAndView handleRequestInternal(HttpServletRequest request,
      HttpServletResponse response) throws Exception {
    FileInfo fileInfo = fileInfoService.load(request.getParameter("FileInfoId"));
    if (fileInfo != null) {
      File file = new File(fileInfo.getFullPath());
      if(!file.exists()) {
        _log.error("File [" + fileInfo.getFullPath() + "] not found.");
      } else {
        response.setContentType("image");
        byte[] bytes = FileCopyUtils.copyToByteArray(file);
        OutputStream outputStream = response.getOutputStream();
        outputStream.write(bytes);
View Full Code Here

Examples of org.pdfclown.tokens.Reader.FileInfo

    IInputStream stream
    ) throws FileFormatException
  {
    reader = new Reader(stream, this);

    FileInfo info = reader.readInfo();
    version = info.getVersion();
    trailer = info.getTrailer();
    if(trailer.containsKey(PdfName.Encrypt)) // Encrypted file.
      throw new NotImplementedException("Encrypted files are currently not supported.");

    indirectObjects = new IndirectObjects(this, info.getXrefEntries());
    document = new Document(trailer.get(PdfName.Root));
    document.getConfiguration().setXrefMode(PdfName.XRef.equals(trailer.get(PdfName.Type)) ? XRefModeEnum.Compressed : XRefModeEnum.Plain);
  }
View Full Code Here

Examples of org.pentaho.platform.engine.core.solution.FileInfo

  public IFileInfo getFileInfo( ISolutionFile solutionFile, InputStream in ) {
    try {
      Document doc = XmlDom4JHelper.getDocFromStream( in );

      IFileInfo info = new FileInfo();
      Node node = doc.selectSingleNode( "state-file/documentation/author" ); //$NON-NLS-1$
      if ( node != null ) {
        info.setAuthor( node.getText() );
      } else {
        info.setAuthor( "" ); //$NON-NLS-1$
      }
      info.setDisplayType( "HTML" ); //$NON-NLS-1$
      node = doc.selectSingleNode( "state-file/documentation/title" ); //$NON-NLS-1$
      if ( node != null ) {
        info.setTitle( node.getText() );
      } else {
        info.setTitle( "" ); //$NON-NLS-1$
      }
      node = doc.selectSingleNode( "state-file/documentation/description" ); //$NON-NLS-1$
      if ( node != null ) {
        info.setDescription( node.getText() );
      } else {
        info.setDescription( "" ); //$NON-NLS-1$
      }
      node = doc.selectSingleNode( "state-file/documentation/icon" ); //$NON-NLS-1$
      if ( node != null ) {
        info.setIcon( node.getText() );
      } else {
        info.setIcon( "" ); //$NON-NLS-1$
      }
      return info;
    } catch ( Exception e ) {
      if ( logger != null ) {
        logger.error( getClass().toString(), e );
View Full Code Here

Examples of org.springframework.batch.admin.service.FileInfo

  @Qualifier("files.json")
  private View view;

  @Test
  public void testListViewWithJobs() throws Exception {
    model.put("files", Arrays.asList(new FileInfo("foo"), new FileInfo("bar")));
    model.put("baseUrl", "http://localhost:8080/springsource");
    view.render(model, request, response);
    String content = response.getContentAsString();
    // System.err.println(content);
    JsonWrapper wrapper = new JsonWrapper(content);
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.