Package org.fife.io

Examples of org.fife.io.UnicodeReader


    DocumentBuilder db = null;
    Document doc = null;
    try {
      db = dbf.newDocumentBuilder();
      //InputSource is = new InputSource(new FileReader(file));
      InputSource is = new InputSource(new UnicodeReader(
                new FileInputStream(file), FILE_ENCODING));
      is.setEncoding(FILE_ENCODING);
      doc = db.parse(is);//db.parse(file);
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here


    }

    // Old local files and remote files, load 'em up.  UnicodeReader will
    // check for BOMs and handle them correctly in all cases, then pass
    // rest of stream down to InputStreamReader.
    UnicodeReader ur = new UnicodeReader(loc.getInputStream(), defaultEnc);
    charSet = ur.getEncoding();

    // Remove listener so dirty flag doesn't get set when loading a file.
    Document doc = getDocument();
    doc.removeDocumentListener(this);
    BufferedReader r = new BufferedReader(ur);
View Full Code Here

   *         occurs reading the file.
   * @see #isLocalAndExists()
   */
  public void reload() throws IOException {
    String oldEncoding = getEncoding();
    UnicodeReader ur = new UnicodeReader(loc.getInputStream(), oldEncoding);
    String encoding = ur.getEncoding();
    BufferedReader r = new BufferedReader(ur);
    try {
      read(r, null); // Dumps old contents.
    } finally {
      r.close();
View Full Code Here

    }

    // Old local files and remote files, load 'em up.  UnicodeReader will
    // check for BOMs and handle them correctly in all cases, then pass
    // rest of stream down to InputStreamReader.
    UnicodeReader ur = new UnicodeReader(loc.getInputStream(), defaultEnc);

    // Remove listener so dirty flag doesn't get set when loading a file.
    Document doc = getDocument();
    doc.removeDocumentListener(this);
    BufferedReader r = new BufferedReader(ur);
    try {
      read(r, null);
    } finally {
      doc.addDocumentListener(this);
      r.close();
    }

    // No IOException thrown, so we can finally change the location.
    charSet = ur.getEncoding();
    String old = getFileFullPath();
    this.loc = loc;
    setDirty(false);
    setCaretPosition(0);
    firePropertyChange(FULL_PATH_PROPERTY, old, getFileFullPath());
View Full Code Here

   *         occurs reading the file.
   * @see #isLocalAndExists()
   */
  public void reload() throws IOException {
    String oldEncoding = getEncoding();
    UnicodeReader ur = new UnicodeReader(loc.getInputStream(), oldEncoding);
    String encoding = ur.getEncoding();
    BufferedReader r = new BufferedReader(ur);
    try {
      read(r, null); // Dumps old contents.
    } finally {
      r.close();
View Full Code Here

    DocumentBuilder db = null;
    Document doc = null;
    try {
      db = dbf.newDocumentBuilder();
      //InputSource is = new InputSource(new FileReader(file));
      InputSource is = new InputSource(new UnicodeReader(
                new FileInputStream(file), FILE_ENCODING));
      is.setEncoding(FILE_ENCODING);
      doc = db.parse(is);//db.parse(file);
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

    DocumentBuilder db = null;
    Document doc = null;
    try {
      db = dbf.newDocumentBuilder();
      //InputSource is = new InputSource(new FileReader(file));
      InputSource is = new InputSource(new UnicodeReader(
                new FileInputStream(file), FILE_ENCODING));
      is.setEncoding(FILE_ENCODING);
      doc = db.parse(is);//db.parse(file);
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

    }

    // Old local files and remote files, load 'em up.  UnicodeReader will
    // check for BOMs and handle them correctly in all cases, then pass
    // rest of stream down to InputStreamReader.
    UnicodeReader ur = new UnicodeReader(loc.getInputStream(), defaultEnc);

    // Remove listener so dirty flag doesn't get set when loading a file.
    Document doc = getDocument();
    doc.removeDocumentListener(this);
    BufferedReader r = new BufferedReader(ur);
    try {
      read(r, null);
    } finally {
      doc.addDocumentListener(this);
      r.close();
    }

    // No IOException thrown, so we can finally change the location.
    charSet = ur.getEncoding();
    String old = getFileFullPath();
    this.loc = loc;
    setDirty(false);
    setCaretPosition(0);
    firePropertyChange(FULL_PATH_PROPERTY, old, getFileFullPath());
View Full Code Here

   *         occurs reading the file.
   * @see #isLocalAndExists()
   */
  public void reload() throws IOException {
    String oldEncoding = getEncoding();
    UnicodeReader ur = new UnicodeReader(loc.getInputStream(), oldEncoding);
    String encoding = ur.getEncoding();
    BufferedReader r = new BufferedReader(ur);
    try {
      read(r, null); // Dumps old contents.
    } finally {
      r.close();
View Full Code Here

TOP

Related Classes of org.fife.io.UnicodeReader

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.