Class ContentUtils
java.lang.Object
org.craftercms.studio.impl.v1.util.ContentUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic InputStream
convertDocumentToStream
(org.dom4j.Document document, String encoding) content the given document to streamstatic org.dom4j.Document
convert InputStream to stringstatic String
getPageName
(String url) Returns the page name part (e.g.index.xml) of a given URLstatic String
getParentUrl
(String url) static boolean
matchesPatterns
(String uri, List<String> patterns) static void
Release a resource
-
Constructor Details
-
ContentUtils
public ContentUtils()
-
-
Method Details
-
release
Release a resource- Parameters:
resource
- resource to close
-
convertStreamToXml
public static org.dom4j.Document convertStreamToXml(InputStream is) throws org.dom4j.DocumentException convert InputStream to string- Parameters:
is
-- Returns:
- string
- Throws:
org.dom4j.DocumentException
-
matchesPatterns
-
getParentUrl
-
getPageName
Returns the page name part (e.g.index.xml) of a given URL- Parameters:
url
-- Returns:
- page name
-
convertDocumentToStream
content the given document to stream- Parameters:
document
-encoding
-- Returns:
- XML as stream
-