Examples of File


Examples of java.io.File

      if (m_FileChooser == null) {
  createFileChooser();
      }
      int returnVal = m_FileChooser.showSaveDialog(this);
      if (returnVal == JFileChooser.APPROVE_OPTION) {
  File sFile = m_FileChooser.getSelectedFile();
  try {
    ObjectOutputStream oo = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(sFile)));
    oo.writeObject(object);
    oo.close();
  } catch (Exception ex) {
    JOptionPane.showMessageDialog(this,
          "Couldn't write to file: "
          + sFile.getName()
          + "\n" + ex.getMessage(),
          "Save object",
          JOptionPane.ERROR_MESSAGE);
  }
      }
View Full Code Here

Examples of java.io.File

    /**
     * Creates the file chooser the user will use to save/load files with.
     */
    protected void createFileChooser() {
     
      m_FileChooser = new JFileChooser(new File(System.getProperty("user.dir")));
      m_FileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
    }
View Full Code Here

Examples of java.io.File

   
    super.setOptions(options);
   
    tmpStr = Utils.getOption("model", options);
    if (tmpStr.length() != 0)
      setModelFile(new File(tmpStr));
    else
      setModelFile(new File(System.getProperty("user.dir")));
  }
View Full Code Here

Examples of java.io.File

                org.apache.synapse.config.xml.endpoints.TemplateFactory templateFactory =
                        new org.apache.synapse.config.xml.endpoints.TemplateFactory();

                Template tm = templateFactory.createEndpointTemplate(artifactConfig, properties);

                tm.setFileName(new File(fileName).getName());
                if (log.isDebugEnabled()) {
                    log.debug("Endpoint Template named '" + tm.getName()
                            + "' has been built from the file " + fileName);
                }

                getSynapseConfiguration().addEndpointTemplate(tm.getName(), tm);
                if (log.isDebugEnabled()) {
                    log.debug("Template Deployment from file : " + fileName + " : Completed");
                }
                log.info("Endpoint Template named '" + tm.getName()
                        + "' has been deployed from file : " + fileName);

                return tm.getName();
            } else {
                element = artifactConfig.getFirstChildWithName(
                        new QName(SynapseConstants.SYNAPSE_NAMESPACE, "sequence"));
                if (element != null) {
                    Mediator mediator = MediatorFactoryFinder.getInstance().
                            getMediator(artifactConfig, properties);
                    if (mediator instanceof TemplateMediator) {
                        TemplateMediator tm = (TemplateMediator) mediator;

                        tm.setFileName((new File(fileName)).getName());
                        if (log.isDebugEnabled()) {
                            log.debug("Sequence Template named '" + tm.getName()
                                    + "' has been built from the file " + fileName);
                        }
View Full Code Here

Examples of java.io.File

                org.apache.synapse.config.xml.endpoints.TemplateFactory templateFactory =
                        new org.apache.synapse.config.xml.endpoints.TemplateFactory();

                Template tm = templateFactory.createEndpointTemplate(artifactConfig, properties);

                tm.setFileName(new File(fileName).getName());
                if (log.isDebugEnabled()) {
                    log.debug("Endpoint Template named '" + tm.getName()
                            + "' has been built from the file " + fileName);
                }

                Template existingSt = getSynapseConfiguration().
                        getEndpointTemplate(existingArtifactName);

                if (existingArtifactName.equals(tm.getName())) {
                    getSynapseConfiguration().updateEndpointTemplate(tm.getName(), existingSt);
                } else {
                    getSynapseConfiguration().addEndpointTemplate(tm.getName(), tm);
                    getSynapseConfiguration().removeEndpointTemplate(existingSt.getName());
                    log.info("Template: " + existingArtifactName + " has been undeployed");
                }

                log.info("Template: " + tm.getName() + " has been updated from the file: " + fileName);
                return tm.getName();
            } else {
                element = artifactConfig.getFirstChildWithName(
                        new QName(SynapseConstants.SYNAPSE_NAMESPACE, "sequence"));
                if (element != null) {
                    Mediator mediator = MediatorFactoryFinder.getInstance().
                            getMediator(artifactConfig, properties);
                    if (mediator instanceof TemplateMediator) {
                        TemplateMediator tm = (TemplateMediator) mediator;

                        tm.setFileName((new File(fileName)).getName());
                        if (log.isDebugEnabled()) {
                            log.debug("Sequence Template named '" + tm.getName()
                                    + "' has been built from the file " + fileName);
                        }
View Full Code Here

Examples of jease.cms.domain.File

    return document;
  }

  private static File newFile(String filename, InputStream inputStream)
      throws IOException {
    File file = new File();
    file.setId(Filenames.asId(filename));
    file.setTitle(Filenames.asTitle(filename));
    file.setLastModified(new Date());
    file.setContentType(Filenames.asContentType(filename));
    copyStreamToFile(inputStream, file.getFile());
    return file;
  }
View Full Code Here

Examples of jxl.read.biff.File

  {
    FileInputStream fis = new FileInputStream(file);

    // Always close down the input stream, regardless of whether or not the
    // file can be parsed.  Thanks to Steve Hahn for this
    File dataFile = null;

    try
    {
      dataFile = new File(fis, ws);
    }
    catch (IOException e)
    {
      fis.close();
      throw e;
View Full Code Here

Examples of lupos.gui.operatorgraph.visualeditor.ruleeditor.util.File

        continue;
      }

      System.out.println(":: copying " + img_path + "...");

      File img = new File(img_path);
      img.copyFileTo(this.targetDirectory + img_name_bit + "." + img.getFileExtension());

      if(img_name_bit.equals("logo")) {
        logo_name = img_name_bit + "." + img.getFileExtension();
      }
    }
    // --- copy images - end ---

    // --- generate rule frame header - begin ---
View Full Code Here

Examples of net.helipilot50.stocktrade.framework.File

   */
    private static int lastCID;

    public SystemAgent() {
        String logLocation = PropertiesMgr.getProperty(PropertiesMgr.cLOGS_LOCATION);
        this.logFile = new File();
        this.logFile.setLocalName(logLocation + "/" + this.getClass().getName() + ".log");
        this.logFile.open(net.helipilot50.stocktrade.framework.Constants.SP_AM_READ_WRITE);

        this.initCmdProcessor();

View Full Code Here

Examples of net.raymanoz.io.File

    String dirName = properties.getString(EXECUTION_DIRECTORY.getKey());
    return createExistingDirectory(dirName, DirType.EXECUTED_SCRIPTS, null);
  }

  private File createExistingDirectory(String dirName, DirType dirType, Long dbversion) {
    File dir = fileUtil.newFile(dirName, dirType, dbversion);
    if (!dir.exists(true)) {
      throw new IllegalStateException(String.format("%s directory '%s' does not exist", dirType.Desc(dbversion), dir));
    }
    return dir;
  }
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.