Package java.io

Examples of java.io.File


  public EndpointReference createEndpoint(EndpointMetaData metaData, WSDLReference wsdlRef, final ClassLoader classLoader)
      throws EndpointManagementException
  {
    try
    {
        File wsdlFile=new File(wsdlRef.getWsdlURL().toURI());
     
      // Find deployment root folder
      File root=wsdlFile.getParentFile();
     
      while (root != null && !(new File(root,
              BPELDeploymentUnit.DEPLOY_XML).exists() ||
              new File(root, BPELDeploymentUnit.BPEL_DEPLOY_XML).exists())) {
        root = root.getParentFile();
      }
     
      if (root == null) {
        throw new EndpointManagementException("Failed to locate root folder of BPEL deployment unit");
      }
     
      // Check if a handler file has been specified
      File handlerFile=new File(root, "jws_handlers.xml");
      String handlerFilePath=null;
     
      if (handlerFile.exists()) {
        handlerFilePath = "/"+handlerFile.getName();
      }

      // generate provider impl
      WebServiceProviderGenerator providerFactory = new WebServiceProviderGenerator();

      BaseWebServiceEndpoint providerImpl =
              providerFactory.createProvider(metaData, wsdlRef, classLoader,
                  handlerFilePath, ODEWebServiceFactory.class);

      log.debug("Created dynamic endpoint class " + providerImpl.getClass().getName());

      // create deployment structure  (maybe replaced by shrinkwrap)
      File warArchive = new DeploymentBuilder(serverConfig)
          .setEndpoint(metaData.getEndpointId())
          .setWSDL(wsdlFile, root)
          .setProvider(providerImpl)
          .process(new JBossWSCXFBuildProcessor(providerImpl))
          .build();
View Full Code Here


      if (log.isDebugEnabled()) {
        log.debug("Undeployed web service with deploymentName="+ref.getDeploymentName());
      }
 
      // remove physical artifacts
      File warArchive = new File(ref.getArchiveLocation());
      if(warArchive.exists())
      {
        if(!deleteDirectory(warArchive)) log.warn(warArchive + " could no be deleted");         
      }
      else
      {
View Full Code Here

    this.provider = provider;
  }
 
  public void process(DeploymentBuilder builder) {
      // Check if jbossws-cxf.xml is present, and if so, updated the provider implementation class attribute
      File f=new File(builder.getWebInf(), "jbossws-cxf.xml");
     
      if (f.exists()) {
        FileInputStream fis=null;
        FileOutputStream fos=null;
       
        try {
          fis=new FileInputStream(f);
View Full Code Here

        try {
            String record = failedObject.getName().getBaseName() + VFSConstants.FAILED_RECORD_DELIMITER
                    + timeString;
            String recordFile = pollTableEntry.getFailedRecordFileDestination() +
                    pollTableEntry.getFailedRecordFileName();
            File failedRecordFile = new File(recordFile);
            if (!failedRecordFile.exists()) {
                FileUtils.writeStringToFile(failedRecordFile, record);
                if (log.isDebugEnabled()) {
                    log.debug("Added fail record '" + record + "' into the record file '"
                            + recordFile + "'");
                }
View Full Code Here

    }

    private boolean isFailedRecord(FileObject fileObject, PollTableEntry entry) {
        String failedFile = entry.getFailedRecordFileDestination() +
                entry.getFailedRecordFileName();
        File file = new File(failedFile);
        if (file.exists()) {
            try {
                List list = FileUtils.readLines(file);
                for (Object aList : list) {
                    String str = (String) aList;
                    StringTokenizer st = new StringTokenizer(str,
View Full Code Here

        HttpHeader header = new HttpHeader("content-type", mimetypestr);
        doc.addHeader(header);
      }
     
      // get the content from the file
      File file = new File(filename);
      if (!file.exists()) {
        doc.setHttpCode("httpcode " + HttpConstants.HTTP_NOTFOUND);
        return doc;
      }
      long fileLastModified = file.lastModified();
      long ifModifiedSinceTime = ifModifiedSince == null ? 0 : ifModifiedSince.getTime();
      if (fileLastModified > ifModifiedSinceTime) {
        byte[] content = readFileToByteArray(file);
        doc.setContent(content);
        doc.setHttpCode("httpcode " + HttpConstants.HTTP_OK);
View Full Code Here

      return getTestFile(testName, archive).toURL();
   }

   /** Try to discover the File for the deployment archive */
   public File getTestFile(String testName, String archive) {
      File file = new File(getTestArchiveDir() + java.io.File.separator+
              testName+ java.io.File.separator + archive);
      if (file.exists())
         return file;

      String notSet = (getTestArchiveDir() == null ? " System property '" + SYSPROP_TEST_ARCHIVE_DIRECTORY + "' not set." : "");
      throw new IllegalArgumentException("Cannot obtain '" + file + "'." + notSet);
   }
View Full Code Here

   
    loader = ConverterUtils.getLoaderForFile(filename);
   
    if (loader != null) {
      try {
        loader.setFile(new File(filename));
        m_Data = loader.getDataSet();
      }
      catch (Exception e) {
        ComponentHelper.showMessageBox(
            null,
View Full Code Here

 
  /**
   * undoes the last action
   */
  public void undo() {
    File                  tempFile;
    Instances             inst;
    ObjectInputStream     ooi;
   
    if (canUndo()) {
      // load file
      tempFile = (File) m_UndoList.get(m_UndoList.size() - 1);
      try {
        // read serialized data
        ooi = new ObjectInputStream(new BufferedInputStream(new FileInputStream(tempFile)));
        inst = (Instances) ooi.readObject();
        ooi.close();
       
        // set instances
        setInstances(inst);
        notifyListener(new TableModelEvent(this, TableModelEvent.HEADER_ROW));
        notifyListener(new TableModelEvent(this));
      }
      catch (Exception e) {
        e.printStackTrace();
      }
      tempFile.delete();
     
      // remove from undo
      m_UndoList.remove(m_UndoList.size() - 1);
    }
  }
View Full Code Here

   * adds an undo point to the undo history, if the undo support is enabled
   * @see #isUndoEnabled()
   * @see #setUndoEnabled(boolean)
   */
  public void addUndoPoint() {
    File                  tempFile;
    ObjectOutputStream    oos;

    // undo support currently on?
    if (!isUndoEnabled())
      return;
   
    if (getInstances() != null) {
      try {
        // temp. filename
        tempFile = File.createTempFile("arffviewer", null);
        tempFile.deleteOnExit();
       
        // serialize instances
        oos = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(tempFile)));
        oos.writeObject(getInstances());
        oos.flush();
View Full Code Here

TOP

Related Classes of java.io.File

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.