Examples of FileInputStream


Examples of java.io.FileInputStream

   * allow|deny mimetype/subtype <xxxx >yyyyy
   */
  public void loadRuleFile(String filename)
    throws IOException
  {
    InputStream is = new FileInputStream(filename);
    BufferedReader reader =
      new BufferedReader(new InputStreamReader(is));

    String line = "";
    int lineno=0;
View Full Code Here

Examples of java.io.FileInputStream

      }
      int returnVal = m_FileChooser.showOpenDialog(this);
      if (returnVal == JFileChooser.APPROVE_OPTION) {
  File selected = m_FileChooser.getSelectedFile();
  try {
    ObjectInputStream oi = new ObjectInputStream(new BufferedInputStream(new FileInputStream(selected)));
    Object obj = oi.readObject();
    oi.close();
    if (!m_ClassType.isAssignableFrom(obj.getClass())) {
      throw new Exception("Object not of type: " + m_ClassType.getName());
    }
View Full Code Here

Examples of java.io.FileInputStream

            // if this is the case then it means that a PMML classifier was
            // successfully loaded earlier in the code
            objectInputStream = null;
            xmlInputStream = null;
          } else {
            InputStream is = new FileInputStream(objectInputFileName);
            if (objectInputFileName.endsWith(".gz")) {
              is = new GZIPInputStream(is);
            }
            // load from KOML?
            if (!(objectInputFileName.endsWith(".koml") && KOML.isPresent()) ) {
View Full Code Here

Examples of java.io.FileInputStream

  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);
         
          byte[] b=new byte[fis.available()];
          fis.read(b);
         
          String str=new String(b);
         
          fis.close();
          fis = null;
         
          if (str.indexOf("@provider@") != -1) {
            fos=new FileOutputStream(f);
           
            str = str.replaceAll("@provider@", provider.getClass().getName());
           
            fos.write(str.getBytes());
           
            fos.flush();
            fos.close();
           
            fos = null;
          } else {
            // Report error
            System.err.println("jbossws-cxf.xml file does not contain @provider@ field");
          }
         
        } catch (IOException e) {
          throw new RuntimeException("Failed to copy files", e);
        } finally {
          try {
            if (fis != null) fis.close();
          } catch (IOException e) {
          }
          try {
            if (fos != null) fos.close();
          } catch (IOException e) {
View Full Code Here

Examples of java.io.FileInputStream

   * @return byte[]
   * @throws IOException
   */
  protected byte[] readFileToByteArray(File file) throws IOException
  {
    FileInputStream in = null;

    try
    {
      byte[] buffer = new byte[(int) file.length()];
      in = new FileInputStream(file);
      in.read(buffer);

      return buffer;
    }
    finally
    {
      if (in != null)
      {
        try
        {
          in.close();
        }
        catch (IOException e)
        {
        }
      }
View Full Code Here

Examples of java.io.FileInputStream

    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);
View Full Code Here

Examples of java.io.FileInputStream

            + "PackageRepository.props");
       
       
        if (repPropsFile.exists()) {
          Properties repProps = new Properties();
          repProps.load(new FileInputStream(repPropsFile));
          repURL = repProps.getProperty("weka.core.wekaPackageRepositoryURL");
        }
      }
     
      if (repURL == null || repURL.length() == 0) {
View Full Code Here

Examples of java.io.FileInputStream

    try {
      Properties expProps = new Properties();
      String explorerProps = getPackageHome().getAbsolutePath()
        + File.separator + installedPackageName + File.separator
        + "Explorer.props";
      BufferedInputStream bi = new BufferedInputStream(new FileInputStream(explorerProps));
      expProps.load(bi);
      bi.close();
      bi = null;
      Set keys = expProps.keySet();
      Iterator keysI = keys.iterator();
View Full Code Here

Examples of java.io.FileInputStream

  }
 
  protected static void processGenericPropertiesCreatorProps(File propsFile) {
    try {
      Properties expProps = new Properties();
      BufferedInputStream bi = new BufferedInputStream(new FileInputStream(propsFile));
      expProps.load(bi);
      bi.close();
      bi = null;
      Properties GPCInputProps = GenericPropertiesCreator.getGlobalInputProperties();
     
View Full Code Here

Examples of java.io.FileInputStream

  }
 
  protected static void processExplorerProps(File propsFile) {
    try {
      Properties expProps = new Properties();
      BufferedInputStream bi = new BufferedInputStream(new FileInputStream(propsFile));
      expProps.load(bi);
      bi.close();
      bi = null;
      Set keys = expProps.keySet();
      Iterator keysI = keys.iterator();
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.