001    package org.fckfaces.util;
002    
003    import javax.faces.context.FacesContext;
004    
005    /**
006     * 
007     */
008    public class Util {
009            
010            /**
011             * 
012             */
013            public static final String FCK_FACES_RESOURCE_PREFIX = "/media";
014    //      public static final String FCK_FACES_RESOURCE_PREFIX = "/fckfaces";
015            
016            /**
017             * Constructor.
018             */
019            private Util() {
020                    throw new UnsupportedOperationException();
021            }
022    
023            /**
024             * @param path
025             * @return x
026             */
027            public static final String internalPath(final String path) {
028                    return FacesContext.getCurrentInstance().getExternalContext().getRequestContextPath() 
029                    + FCK_FACES_RESOURCE_PREFIX + path;
030            }
031            
032            /**
033             * @param path
034             * @return x
035             */
036            public static final String externalPath(final String path) {
037                    return FacesContext.getCurrentInstance().getExternalContext().getRequestContextPath() + path;
038            }
039    }