|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.xmlmind.fo.graphic.GraphicUtil
public final class GraphicUtil
A collection of functions (static methods) useful to implement
GraphicFactories.
| Method Summary | |
|---|---|
static String |
createTempFile(GraphicEnv graphicEnv,
String suffix)
Not for public use: needed to implement GraphicFactories.cs. |
static String |
extensionToFormat(File file)
Equivalent to extensionToFormat(file.getPath()). |
static String |
extensionToFormat(String path)
Returns the MIME type corresponding to the extension of the specified filename, when this extension is known. |
static String |
formatToExtension(String format)
Returns the filename extension corresponding to specified MIME type. |
static String |
formatToSuffix(String format)
Similar to formatToExtension(java.lang.String) except that it prepends
"." to the filename extension and that it never
returns null (the fallback suffix is ".img"). |
static void |
saveGraphic(Graphic graphic,
File outFile)
Saves specified graphic to specified file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static String extensionToFormat(File file)
extensionToFormat(file.getPath()).
public static String extensionToFormat(String path)
null otherwise.
For example, returns "image/jpeg" for "/tmp/foo.jpg".
public static String formatToExtension(String format)
format - a MIME type
null
if such extension cannot be determined.public static String formatToSuffix(String format)
formatToExtension(java.lang.String) except that it prepends
"." to the filename extension and that it never
returns null (the fallback suffix is ".img").
public static void saveGraphic(Graphic graphic,
File outFile)
throws IOException
This function supports graphics having a "data:" location.
graphic - graphic to be savedoutFile - save file
IOException - if an I/O error occurs during the operationURLUtil.openStream(java.lang.String)
public static String createTempFile(GraphicEnv graphicEnv,
String suffix)
throws Exception
Exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||