Skip to content

Commit

Permalink
Migration from CVS to SVN
Browse files Browse the repository at this point in the history
  • Loading branch information
galan committed Apr 16, 2008
1 parent 219ab4d commit 53f4d29
Show file tree
Hide file tree
Showing 128 changed files with 6,737 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .checkstyle
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<fileset-config file-format-version="1.2.0" simple-config="true">
<fileset name="Alle" enabled="true" check-config-name="Sun Checks" local="false">
<file-match-pattern match-pattern="." include-pattern="true"/>
</fileset>
</fileset-config>
20 changes: 20 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="packtag-core/src/main/java"/>
<classpathentry kind="src" output="target/test-classes" path="packtag-core/src/test/java">
<attributes>
<attribute name="maven.type" value="test"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="packtag-core/src/main/resources" path="packtag-core/src/main/resources"/>
<classpathentry excluding="**" kind="src" output="packtag-core/src/test/resources" path="packtag-core/src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v5.5"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER/modules">
<attributes>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
36 changes: 36 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>packtag</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.maven.ide.eclipse.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.maven.ide.eclipse.maven2Nature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
</natures>
</projectDescription>
458 changes: 458 additions & 0 deletions LICENSE.txt

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
pack:tag
A JSP Taglib for delivering minified, combined and gzip-compressed resources (JavaScript and CSS).

To enable pack:tag in your application do the following:
- Copy the packtag.jar to your /WEB-INF/lib directory
- Add the <servlet> and <servlet-mapping> from the web.xml to your /WEB-INF/web.xml

To customize pack:tag copy the packtag.properties file to your /WEB-INF directory and edit it.

For detailed instructions look here:
http://www.galan.de/projects/packtag
181 changes: 181 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
<?xml version="1.0" encoding="UTF-8"?>

<project name="packtag" default="build">

<property name="application.version" value="3.3"/>
<property name="application.name" value="packtag"/>
<property name="application.jar" value="${application.name}-${application.version}.jar"/>
<property name="application.company" value="n/a"/>

<property name="dir.working" location="."/>
<property name="dir.dist" location="${dir.working}/dist"/>

<property name="dir.lib" location="${dir.working}/lib"/>
<property name="dir.lib.support" location="${dir.lib}/support"/>
<property name="dir.lib.web" location="${dir.lib}/web"/>

<property name="dir.classes" location="${dir.working}/classes"/>

<property name="dir.main.src" location="${dir.working}/packtag-core/src/main/java"/>
<property name="dir.main.resources" location="${dir.working}/packtag-core/src/main/resources"/>
<property name="dir.webapp" location="${dir.working}/packtag-testsite/src/main/webapp"/>

<property name="dir.dist.docs" location="${dir.dist}/javadocs"/>
<property name="dir.dist.files" location="${dir.dist}/files"/>
<property name="dir.dist.meta-inf" location="${dir.dist}/META-INF"/>

<property name="file.tld" location="${dir.main.resources}/META-INF/packtag.tld"/>
<property name="file.web.xml" location="${dir.webapp}/WEB-INF/web.xml"/>
<property name="file.licence" location="${dir.working}/LICENSE.txt"/>
<property name="file.readme" location="${dir.working}/README.txt"/>
<property name="file.properties.packtag" location="${dir.webapp}/WEB-INF/packtag.properties"/>
<property name="file.properties.packtag.user" location="${dir.webapp}/WEB-INF/packtag.user.properties"/>
<property name="file.release" location="${dir.dist}/${application.name}-${application.version}.zip"/>
<property name="file.releases" location="${dir.working}/releases.txt"/>



<path id="classpath.packtag">
<fileset dir="${dir.lib.support}">
<include name="*.jar"/>
</fileset>
<fileset dir="${dir.lib.web}">
<include name="*.jar"/>
</fileset>
</path>



<taskdef name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
<classpath>
<pathelement location="${dir.lib.support}/ant-junit-1.6.5.jar"/>
<pathelement location="${dir.lib.support}/junit-3.8.1.jar"/>
</classpath>
</taskdef>



<target name="build" depends="clean, compile, tests" description="builds the sources">
</target>



<target name="clean" description="deletes the builded sources and ">
<delete dir="${dir.classes}"/>
<mkdir dir="${dir.classes}"/>
<delete dir="${dir.dist}"/>
<mkdir dir="${dir.dist}"/>
</target>



<target name="compile" depends="clean, copy-resources">
<javac srcdir="${dir.main.src}"
destdir="${dir.classes}"
classpathref="classpath.packtag"
source="1.4"
target="1.4"
debug="on"
fork="yes"
encoding="ISO-8859-1"
debuglevel="lines,vars,source"
deprecation="on"/>
</target>



<target name="copy-resources">
<copy todir="${dir.classes}">
<fileset dir="${dir.main.resources}">
<include name="**/*.properties"/>
<include name="**/*.tld"/>
<include name="**/*.gif"/>
<include name="**/*.jpg"/>
<include name="**/*.jar"/>
<include name="**/*.png"/>
<include name="**/*.licence"/>
<include name="**/*.txt"/>
<include name="**/*.css"/>
<include name="**/*.js"/>
<include name="**/*.xml"/>
</fileset>
</copy>
</target>



<target name="release" depends="build-release" description="creates a complete clean distribution">
<zip destfile="${file.release}" basedir="${dir.dist}"/>
</target>



<target name="build-release" depends="build,build-docs">
<mkdir dir="${dir.dist.files}"/>
<mkdir dir="${dir.dist.meta-inf}"/>
<jar destfile="${dir.dist.files}/${application.name}-${application.version}.jar"
index="false"
basedir="${dir.classes}"
excludes="net/sf/packtag/test/**/*">
<fileset dir="${dir.dist}">
<include name="META-INF/packtag.tld"/>
</fileset>
<manifest>
<attribute name="Manifest-Version" value="1.0"/>
<attribute name="Created-By" value="Daniel Galán y Martins"/>
<attribute name="Implementation-Title" value="${application.name}"/>
<attribute name="Implementation-Version" value="${application.version}"/>
</manifest>
</jar>
<delete dir="${dir.dist.meta-inf}"/>
<copy file="${file.licence}" todir="${dir.dist}"/>
<copy file="${file.properties.packtag}" todir="${dir.dist.files}"/>
<copy file="${file.properties.packtag.user}" todir="${dir.dist.files}"/>
<copy file="${file.web.xml}" todir="${dir.dist.files}"/>
<copy file="${file.readme}" todir="${dir.dist}"/>
<copy file="${file.releases}" todir="${dir.dist}"/>
</target>



<target name="build-docs" depends="clean">
<mkdir dir="${dir.dist.docs}"/>
<javadoc sourcepath="${dir.main.src}"
destdir="${dir.dist.docs}"
packagenames="net.sf.*"
classpathref="classpath.packtag"
source="1.4"
Private="off"
Protected="on"
Version="on"
Use="on"
Author="on"
Splitindex="on"
link="http://java.sun.com/j2se/1.4.2/docs/api/"
Windowtitle="pack:tag API Documentation"
Doctitle="${application.name}, Version ${application.version}"
header="${application.name}"
footer="${application.company}">
<link href="http://java.sun.com/j2se/1.4.2/docs/api/"/>
</javadoc>
</target>



<target name="tests">
<junit printsummary="on" haltonfailure="on" fork="yes" dir="${dir.classes}">
<jvmarg value="-Dfile.encoding=ISO-8859-1"/>
<classpath>
<path refid="classpath.packtag"/>
<pathelement location="${dir.classes}"/>
</classpath>
<formatter type="xml"/>
<batchtest>
<fileset dir="${dir.classes}">
<include name="net/sf/packtag/**/*Test.class"/>
</fileset>
</batchtest>
</junit>
</target>

</project>
Binary file added lib/contrib/apache-log4j-1.2.15.zip
Binary file not shown.
Binary file added lib/contrib/custom_rhino.jar
Binary file not shown.
Binary file added lib/contrib/jakarta-taglibs-standard-1.1.2.zip
Binary file not shown.
Binary file added lib/contrib/logging-log4j-1.2.14.zip
Binary file not shown.
Binary file added lib/contrib/rhino1_6R6.zip
Binary file not shown.
Binary file added lib/contrib/rhino1_6R7.zip
Binary file not shown.
Binary file added lib/contrib/yuicompressor-2.2.5.zip
Binary file not shown.
Binary file added lib/contrib/yuicompressor-2.3.5.zip
Binary file not shown.
Binary file added lib/support/ant-junit-1.6.5.jar
Binary file not shown.
Binary file added lib/support/checkstyle-all-4.3.jar
Binary file not shown.
Binary file added lib/support/j2ee-1.3.1.jar
Binary file not shown.
Binary file added lib/support/jstl.jar
Binary file not shown.
Binary file added lib/support/junit-3.8.1.jar
Binary file not shown.
Binary file added lib/support/log4j-1.2.15.jar
Binary file not shown.
Binary file added lib/support/standard.jar
Binary file not shown.
Binary file added lib/web/jawr-1.4.jar
Binary file not shown.
Binary file added lib/web/yuicompressor-2.3.5.jar
Binary file not shown.
79 changes: 79 additions & 0 deletions packtag-core/src/main/java/net/sf/packtag/cache/PackCache.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/**
* Project pack:tag >> http://packtag.sf.net
*
* This software is published under the terms of the LGPL
* License version 2.1, a copy of which has been included with this
* distribution in the 'lgpl.txt' file.
*
* Creation date: 12.04.2007 - 21:46:36
* Last author: $Author: danielgalan $
* Last modified: $Date: 2007/11/12 22:57:24 $
* Revision: $Revision: 1.3 $
*
* $Log: PackCache.java,v $
* Revision 1.3 2007/11/12 22:57:24 danielgalan
* renamed sqp to absolutePath and fqp to mappedPath
*
* Revision 1.2 2007/05/02 21:38:37 danielgalan
* alias to name
*
* Revision 1.1 2007/04/22 19:04:21 danielgalan
* pack.tag moved from subversion to good old CVS
*
*/
package net.sf.packtag.cache;

/**
* Singleton to the Cache
*
* @author Daniel Galán y Martins
* @version $Revision: 1.3 $
*/
public class PackCache {

private static PackCache instance;
private final ResourceCache resourceCache = new ResourceCache();


private static PackCache getInstance() {
if (instance == null) {
synchronized (PackCache.class) {
if (instance == null) {
instance = new PackCache();
}
}
}
return instance;
}


private ResourceCache getResourceCache() {
return resourceCache;
}


public static Resource getResourceByAbsolutePath(final String absolutePath) {
return getInstance().getResourceCache().getResourceByAbsolutePath(absolutePath);
}


public static Resource getResourceByMappedPath(final String mappedPath) {
return getInstance().getResourceCache().getResourceByMappedPath(mappedPath);
}


public static boolean existResource(final String absolutePath) {
return getInstance().getResourceCache().existResource(absolutePath);
}


public static void store(final Resource resource, final boolean clearDependingCombinedResources) {
getInstance().getResourceCache().store(resource, clearDependingCombinedResources);
}


public static void clearCache() {
getInstance().getResourceCache().clearCache();
}

}
Loading

0 comments on commit 53f4d29

Please sign in to comment.