Examples of FileStat


Examples of net.sf.jhylafax.JobHelper.FileStat

      putValue(ICON_FILENAME, "editdelete.png");
    }

    public void actionPerformed(ActionEvent e)
    {
      FileStat selectedFile = getSelectedFile();
      if (selectedFile == null) {
        return;
      }

      if (Dialogs.showConfirmDialog(JHylaFAX.getInstance(),
View Full Code Here

Examples of net.sf.jhylafax.JobHelper.FileStat

      putValue(ICON_FILENAME, "filesaveas.png");
    }

    public void actionPerformed(ActionEvent e)
    {
      FileStat selectedFile = getSelectedFile();
      if (selectedFile == null) {
        return;
      }
     
      JFileChooser chooser = new JFileChooser();
View Full Code Here

Examples of net.sf.jhylafax.JobHelper.FileStat

      putValue(ICON_FILENAME, "viewmag.png");
    }

    public void actionPerformed(ActionEvent event)
    {
      FileStat selectedFile = getSelectedFile();
      if (selectedFile == null) {
        return;
      }
     
      String viewerPath = JHylaFAXHelper.getViewerPath(getQueueName());
View Full Code Here

Examples of net.sf.jhylafax.JobHelper.FileStat

    if (row == -1) {
      return null;
    }
    else {
      ReceivedFax doc = faxTableModel.getDocument(row);
      return new FileStat(doc.getFilename(), doc.getFilesize());
    }
  }
View Full Code Here

Examples of net.sf.jhylafax.JobHelper.FileStat

    faxTableModel.setData(data);
  }

  @Override
  public void updateActions() {
    FileStat file = getSelectedFile();
    viewAction.setEnabled(file != null);
    saveAction.setEnabled(file != null);
    deleteAction.setEnabled(file != null);
  }
View Full Code Here

Examples of net.sf.jhylafax.JobHelper.FileStat

    if (row == -1) {
      return null;
    }
    else {
      Document doc = docTableModel.getDocument(row);
      return new FileStat(doc.getFilename(), doc.getFilesize());
    }
  }
View Full Code Here

Examples of net.sf.jhylafax.JobHelper.FileStat

    docTableModel.setData(data);
  }

  @Override
  public void updateActions() {
    FileStat file = getSelectedFile();
    viewAction.setEnabled(file != null);
    saveAction.setEnabled(file != null);
    deleteAction.setEnabled(file != null);
  }
View Full Code Here

Examples of org.jruby.ext.posix.FileStat

            File s = new File("/etc/shadow");
            if(s.exists() && !s.canRead()) {
                // it looks like shadow password is in use, but we don't have read access
                LOGGER.fine("/etc/shadow exists but not readable");
                POSIX api = PosixAPI.get();
                FileStat st = api.stat("/etc/shadow");
                if(st==null)
                    return FormValidation.error(Messages.PAMSecurityRealm_ReadPermission());

                Passwd pwd = api.getpwuid(api.geteuid());
                String user;
                if(pwd!=null)   user=Messages.PAMSecurityRealm_User(pwd.getLoginName());
                else            user=Messages.PAMSecurityRealm_CurrentUser();

                String group;
                Group g = api.getgrgid(st.gid());
                if(g!=null)     group=g.getName();
                else            group=String.valueOf(st.gid());

                if ((st.mode()&FileStat.S_IRGRP)!=0) {
                    // the file is readable to group. Jenkins should be in the right group, then
                    return FormValidation.error(Messages.PAMSecurityRealm_BelongToGroup(user, group));
                } else {
                    Passwd opwd = api.getpwuid(st.uid());
                    String owner;
                    if(opwd!=nullowner=opwd.getLoginName();
                    else            owner=Messages.PAMSecurityRealm_Uid(st.uid());

                    return FormValidation.error(Messages.PAMSecurityRealm_RunAsUserOrBelongToGroupAndChmod(owner, user, group));
                }
            }
            return FormValidation.ok(Messages.PAMSecurityRealm_Success());
View Full Code Here

Examples of org.jruby.ext.posix.FileStat

        }

        try {// try libc chmod
            POSIX posix = PosixAPI.get();
            String path = f.getAbsolutePath();
            FileStat stat = posix.stat(path);
            posix.chmod(path, stat.mode()|0200); // u+w
        } catch (Throwable t) {
            LOGGER.log(Level.FINE,"Failed to chmod(2) "+f,t);
        }

    }
View Full Code Here

Examples of org.jruby.ext.posix.FileStat

                    new IRubyObject[]{runtime.newString(filename), runtime.newString("w")}, Block.NULL_BLOCK));
        }

        private void inplaceEdit(ThreadContext context, String filename, String extension) throws RaiseException {
            File file = new File(filename);
            FileStat stat = runtime.getPosix().stat(filename);

            if (!extension.equals("")) {
                file.renameTo(new File(filename + extension));
            } else {
                file.delete();
            }

            createNewFile(file);

            runtime.getPosix().chmod(filename, stat.mode());
            runtime.getPosix().chown(filename, stat.uid(), stat.gid());
            runtime.getGlobalVariables().set("$stdout", (RubyIO) RubyFile.open(context, runtime.getFile(),
                    new IRubyObject[]{runtime.newString(filename), runtime.newString("w")}, Block.NULL_BLOCK));
        }
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.