char [] buf = new char[length]; is = new BufferedInputStream(sunResourcesFO.getInputStream()); String encoding = EncodingUtil.detectEncoding(is); reader = new InputStreamReader(is, encoding); int max = reader.read(buf);
public SpringXMLConfigDataObject(FileObject pf, SpringXMLConfigDataLoader loader) throws DataObjectExistsException { super(pf, loader); CookieSet cookies = getCookieSet(); InputSource in = DataObjectAdapters.inputSource(this); cookies.add(new CheckXMLSupport(in)); cookies.add(new ValidateXMLSupport(in)); cookies.assign(FileEncodingQueryImplementation.class, XmlFileEncodingQueryImpl.singleton()); registerEditor(SpringConstants.CONFIG_MIME_TYPE, true); }
private void init() { CookieSet cookies = getCookieSet(); cookies.add(JSFConfigEditorSupport.class, this); //Lookup JSFConfigEditorContext for Page Flow Editor multiview cookies.assign(JSFConfigEditorContext.class, new JSFConfigEditorContextImpl((JSFConfigDataObject)this)); // Creates Check XML and Validate XML context actions InputSource in = DataObjectAdapters.inputSource(this); cookies.add(new CheckXMLSupport(in)); cookies.add(new ValidateXMLSupport(in)); cookies.assign(FileEncodingQueryImplementation.class, XmlFileEncodingQueryImpl.singleton()); }
String defaultEncoding = "UTF-8"; // NOI18N String enc = EncodingUtil.detectEncoding(doc); boolean changeEncodingToDefault = false; if (enc == null) enc = defaultEncoding;
ValidateXMLCookie validateCookie = new ValidateXMLSupport(in); getCookieSet().add(validateCookie); getCookieSet().assign(FileEncodingQueryImplementation.class, XmlFileEncodingQueryImpl.singleton()); if (debug) System.out.println("====> TLDDataObject(FileObject, loader):constructor()"); // NOI18N
String defaultEncoding = "UTF-8"; // NOI18N String enc = EncodingUtil.detectEncoding(doc); boolean changeEncodingToDefault = false; if (enc == null) {