Tabnine Logo
IOUtils
Code IndexAdd Tabnine to your IDE (free)

How to use
IOUtils
in
chameleon.io

Best Java code snippets using chameleon.io.IOUtils (Showing top 11 results out of 315)

origin: com.github.muff1nman.chameleon/playlist-rmp

@Override
public SpecificPlaylist readFrom(final InputStream in, final String encoding, final Log logger) throws Exception
{
  String enc = encoding;
  if (enc == null)
  {
    enc = "UTF-8";
  }
  String str = IOUtils.toString(in, enc); // May throw IOException. Throws NullPointerException if in is null.
  // Replace all occurrences of a single '&' with "&" (or leave this construct as is).
  // First replace blindly all '&' to its corresponding character reference.
  str = str.replace("&", "&");
  // Then restore any existing character reference.
  str = str.replaceAll("&([a-zA-Z0-9#]+;)", "&$1"); // Shall not throw PatternSyntaxException.
  // Unmarshal the RMP playlist.
  final StringReader reader = new StringReader(str);
  final JAXBContext jc = JAXBContext.newInstance("chameleon.playlist.rmp"); // May throw JAXBException.
  final Unmarshaller unmarshaller = jc.createUnmarshaller(); // May throw JAXBException.
  final SpecificPlaylist ret = (SpecificPlaylist) unmarshaller.unmarshal(reader); // May throw JAXBException, UnmarshalException. Shall not throw IllegalArgumentException.
  ret.setProvider(this);
  return ret;
}
origin: com.github.muff1nman.chameleon/playlist-smil

@Override
public SpecificPlaylist readFrom(final InputStream in, final String encoding, final Log logger) throws Exception
{
  String enc = encoding;
  if (enc == null)
  {
    enc = "UTF-8";
  }
  String str = IOUtils.toString(in, enc); // May throw IOException. Throws NullPointerException if in is null.
  // Replace all occurrences of a single '&' with "&" (or leave this construct as is).
  // First replace blindly all '&' to its corresponding character reference.
  str = str.replace("&", "&");
  // Then restore any existing character reference.
  str = str.replaceAll("&([a-zA-Z0-9#]+;)", "&$1"); // Shall not throw PatternSyntaxException.
  // Unmarshal the SMIL playlist.
  final XmlSerializer serializer = XmlSerializer.getMapping("chameleon/playlist/smil"); // May throw Exception.
  serializer.getUnmarshaller().setIgnoreExtraElements(true); // Many SMIL elements are not implemented yet.
  final StringReader reader = new StringReader(str);
  final SpecificPlaylist ret = (SpecificPlaylist) serializer.unmarshal(reader); // May throw Exception.
  ret.setProvider(this);
  return ret;
}
origin: com.github.muff1nman.chameleon/playlist-wpl

@Override
public SpecificPlaylist readFrom(final InputStream in, final String encoding, final Log logger) throws Exception
{
  String enc = encoding;
  if (enc == null)
  {
    enc = "UTF-8";
  }
  String str = IOUtils.toString(in, enc); // May throw IOException. Throws NullPointerException if in is null.
  // Replace all occurrences of a single '&' with "&" (or leave this construct as is).
  // First replace blindly all '&' to its corresponding character reference.
  str = str.replace("&", "&");
  // Then restore any existing character reference.
  str = str.replaceAll("&([a-zA-Z0-9#]+;)", "&$1"); // Shall not throw PatternSyntaxException.
  // Unmarshal the WPL playlist.
  final XmlSerializer serializer = XmlSerializer.getMapping("chameleon/playlist/wpl"); // May throw Exception.
  serializer.getUnmarshaller().setIgnoreExtraElements(false); // Force an error if unknown elements are found.
  final StringReader reader = new StringReader(str);
  final SpecificPlaylist ret = (SpecificPlaylist) serializer.unmarshal(reader); // May throw Exception.
  ret.setProvider(this);
  return ret;
}
origin: com.github.muff1nman.chameleon/playlist-b4s

@Override
public SpecificPlaylist readFrom(final InputStream in, final String encoding, final Log logger) throws Exception
{
  String enc = encoding;
  if (enc == null)
  {
    enc = "UTF-8";
  }
  String str = IOUtils.toString(in, enc); // May throw IOException. Throws NullPointerException if in is null.
  // Replace all occurrences of a single '&' with "&" (or leave this construct as is).
  // First replace blindly all '&' to its corresponding character reference.
  str = str.replace("&", "&");
  // Then restore any existing character reference.
  str = str.replaceAll("&([a-zA-Z0-9#]+;)", "&$1"); // Shall not throw PatternSyntaxException.
  // Unmarshal the B4S playlist.
  final XmlSerializer serializer = XmlSerializer.getMapping("chameleon/playlist/b4s"); // May throw Exception.
  serializer.getUnmarshaller().setIgnoreExtraElements(false); // Force an error if unknown elements are found.
  final StringReader reader = new StringReader(str);
  final SpecificPlaylist ret = (SpecificPlaylist) serializer.unmarshal(reader); // May throw Exception.
  ret.setProvider(this);
  return ret;
}
origin: com.github.muff1nman.chameleon/playlist-xspf

@Override
public SpecificPlaylist readFrom(final InputStream in, final String encoding, final Log logger) throws Exception
{
  String enc = encoding;
  if (enc == null)
  {
    enc = "UTF-8";
  }
  String str = IOUtils.toString(in, enc); // May throw IOException. Throws NullPointerException if in is null.
  // Replace all occurrences of a single '&' with "&" (or leave this construct as is).
  // First replace blindly all '&' to its corresponding character reference.
  str = str.replace("&", "&");
  // Then restore any existing character reference.
  str = str.replaceAll("&([a-zA-Z0-9#]+;)", "&$1"); // Shall not throw PatternSyntaxException.
  // Unmarshal the WPL playlist.
  final XmlSerializer serializer = XmlSerializer.getMapping("chameleon/playlist/xspf"); // May throw Exception.
  serializer.getUnmarshaller().setIgnoreExtraElements(true);
  final StringReader reader = new StringReader(str);
  final SpecificPlaylist ret = (SpecificPlaylist) serializer.unmarshal(reader); // May throw Exception.
  ret.setProvider(this);
  return ret;
}
origin: com.github.muff1nman.chameleon/playlist-hypetape

@Override
public SpecificPlaylist readFrom(final InputStream in, final String encoding, final Log logger) throws Exception
{
  String enc = encoding;
  if (enc == null)
  {
    enc = "UTF-8";
  }
  String str = IOUtils.toString(in, enc); // May throw IOException. Throws NullPointerException if in is null.
  // Replace all occurrences of a single '&' with "&" (or leave this construct as is).
  // First replace blindly all '&' to its corresponding character reference.
  str = str.replace("&", "&");
  // Then restore any existing character reference.
  str = str.replaceAll("&([a-zA-Z0-9#]+;)", "&$1"); // Shall not throw PatternSyntaxException.
  // Unmarshal the WPL playlist.
  final XmlSerializer serializer = XmlSerializer.getMapping(
      "chameleon/playlist/hypetape"); // May throw Exception.
  serializer.getUnmarshaller().setIgnoreExtraElements(false);
  final StringReader reader = new StringReader(str);
  final SpecificPlaylist ret = (SpecificPlaylist) serializer.unmarshal(reader); // May throw Exception.
  ret.setProvider(this);
  return ret;
}
origin: com.github.muff1nman.chameleon/playlist-asx

String str = IOUtils.toString(in, enc); // May throw IOException. Throws NullPointerException if in is null.
origin: com.github.muff1nman.chameleon/playlist-plist

@Override
public SpecificPlaylist readFrom(final InputStream in, final String encoding, final Log logger) throws Exception
{
  String enc = encoding;
  if (enc == null)
  {
    enc = "UTF-8";
  }
  String str = IOUtils.toString(in, enc); // May throw IOException. Throws NullPointerException if in is null.
  // Replace all occurrences of a single '&' with "&" (or leave this construct as is).
  // First replace blindly all '&' to its corresponding character reference.
  str = str.replace("&", "&");
  // Then restore any existing character reference.
  str = str.replaceAll("&([a-zA-Z0-9#]+;)", "&$1"); // Shall not throw PatternSyntaxException.
  // Unmarshal the playlist.
  final XmlSerializer serializer = XmlSerializer.getMapping("chameleon/plist"); // May throw Exception.
  serializer.getUnmarshaller().setIgnoreExtraElements(false); // Force an error if unknown elements are found.
  final StringReader reader = new StringReader(str);
  final Plist plist = (Plist) serializer.unmarshal(reader); // May throw Exception.
  final PlistPlaylist ret = new PlistPlaylist();
  ret.setProvider(this);
  ret.setPlist(plist);
  return ret;
}
origin: com.github.muff1nman.chameleon/playlist-atom

@Override
public SpecificPlaylist readFrom(final InputStream in, final String encoding, final Log logger) throws Exception
{
  String enc = encoding;
  if (enc == null)
  {
    enc = "UTF-8";
  }
  String str = IOUtils.toString(in, enc); // May throw IOException. Throws NullPointerException if in is null.
  // Replace all occurrences of a single '&' with "&" (or leave this construct as is).
  // First replace blindly all '&' to its corresponding character reference.
  str = str.replace("&", "&");
  // Then restore any existing character reference.
  str = str.replaceAll("&([a-zA-Z0-9#]+;)", "&$1"); // Shall not throw PatternSyntaxException.
  // Workaround Castor bug 2521:
  str = str.replace("xmlns=\"http://www.w3.org/2005/Atom\"", "");
  // Unmarshal the SMIL playlist.
  final XmlSerializer serializer = XmlSerializer.getMapping("chameleon/atom"); // May throw Exception.
  serializer.getUnmarshaller().setIgnoreExtraElements(true);
  final StringReader reader = new StringReader(str);
  // TODO Allow also an Entry.
  final Feed feed = (Feed) serializer.unmarshal(reader); // May throw Exception.
  final AtomPlaylist ret = new AtomPlaylist();
  ret.setProvider(this);
  ret.setFeed(feed);
  return ret;
}
origin: com.github.muff1nman.chameleon/playlist-kpl

String str = IOUtils.toString(in, enc); // May throw IOException. Throws NullPointerException if in is null.
origin: com.github.muff1nman.chameleon/playlist-rss

@Override
public SpecificPlaylist readFrom(final InputStream in, final String encoding, final Log logger) throws Exception
{
  String enc = encoding;
  if (enc == null)
  {
    enc = "UTF-8";
  }
  String str = IOUtils.toString(in, enc); // May throw IOException. Throws NullPointerException if in is null.
  // Replace all occurrences of a single '&' with "&" (or leave this construct as is).
  // First replace blindly all '&' to its corresponding character reference.
  str = str.replace("&", "&");
  // Then restore any existing character reference.
  str = str.replaceAll("&([a-zA-Z0-9#]+;)", "&$1"); // Shall not throw PatternSyntaxException.
  // Unmarshal the SMIL playlist.
  final XmlSerializer serializer = XmlSerializer.getMapping("chameleon/rss"); // May throw Exception.
  serializer.getUnmarshaller().setIgnoreExtraElements(true);
  final StringReader reader = new StringReader(str);
  final RSS rss = (RSS) serializer.unmarshal(reader); // May throw Exception.
  final RSSPlaylist ret = new RSSPlaylist();
  ret.setProvider(this);
  ret.setRSS(rss);
  return ret;
}
chameleon.ioIOUtils

Javadoc

General IO manipulation.

Most used methods

  • toString
    Copies the contents of the specified input stream to a string, using the specified character encodin

Popular in Java

  • Updating database using SQL prepared statement
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getSupportFragmentManager (FragmentActivity)
  • addToBackStack (FragmentTransaction)
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Table (org.hibernate.mapping)
    A relational table
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now