info.magnolia.dam.util
Class AssetUtil

java.lang.Object
  extended by info.magnolia.dam.util.AssetUtil

public class AssetUtil
extends Object

Utility method for Asset.


Constructor Summary
AssetUtil()
           
 
Method Summary
static Asset createAsset(File file, String path)
          Deprecated. This is temporary solution. More complete solution will be provided in version 1.3.
static Asset createAsset(InputStream stream, String targetPath, String extension)
          Deprecated. This is temporary solution. More complete solution will be provided in version 1.3.
static String getEncodedFileName(Asset asset)
          Encode the FileName in a UTF-8 bases.
static String replaceSpecialCharacters(String fileName)
          Replace the following characters: «,»,<,>,",',/,\ they make issue with ie.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AssetUtil

public AssetUtil()
Method Detail

getEncodedFileName

public static String getEncodedFileName(Asset asset)
Encode the FileName in a UTF-8 bases.


replaceSpecialCharacters

public static String replaceSpecialCharacters(String fileName)
Replace the following characters: «,»,<,>,",',/,\ they make issue with ie.

Returns:
filename where defined characters are replaced by underscore

createAsset

public static Asset createAsset(File file,
                                String path)
                         throws javax.jcr.RepositoryException,
                                IOException
Deprecated. This is temporary solution. More complete solution will be provided in version 1.3.

Throws:
javax.jcr.RepositoryException
IOException

createAsset

public static Asset createAsset(InputStream stream,
                                String targetPath,
                                String extension)
                         throws javax.jcr.RepositoryException,
                                IOException
Deprecated. This is temporary solution. More complete solution will be provided in version 1.3.

Throws:
javax.jcr.RepositoryException
IOException


Copyright © 2014 Magnolia International Ltd.. All Rights Reserved.