"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tapestry-core/src/main/java/org/apache/tapestry5/internal/services/assets/ChecksumPath.java" between
apache-tapestry-5.6.2-sources.zip and apache-tapestry-5.6.3-sources.zip

About: Apache Tapestry is a framework for creating dynamic, robust, highly scalable web applications in Java. Source code.

ChecksumPath.java  (apache-tapestry-5.6.2-sources):ChecksumPath.java  (apache-tapestry-5.6.3-sources)
skipping to change at line 30 skipping to change at line 30
import java.io.IOException; import java.io.IOException;
/** /**
* Utility used by {@link org.apache.tapestry5.services.assets.AssetRequestHandl er} implementations * Utility used by {@link org.apache.tapestry5.services.assets.AssetRequestHandl er} implementations
* where the first folder in the extra path is actually a computed checksum of t he resource's content. * where the first folder in the extra path is actually a computed checksum of t he resource's content.
* *
* @since 5.4 * @since 5.4
*/ */
public class ChecksumPath public class ChecksumPath
{ {
private static final String NON_EXISTING_RESOURCE = "_______________________ __"; static final String NON_EXISTING_RESOURCE = "_________________________";
public final String checksum; public final String checksum;
public final String resourcePath; public final String resourcePath;
private final ResourceStreamer streamer; private final ResourceStreamer streamer;
public ChecksumPath(ResourceStreamer streamer, String baseFolder, String ext raPath) public ChecksumPath(ResourceStreamer streamer, String baseFolder, String ext raPath)
{ {
this.streamer = streamer; this.streamer = streamer;
int slashx = extraPath.indexOf('/'); int slashx = extraPath.indexOf('/');
checksum = extraPath.substring(0, slashx); checksum = extraPath.substring(0, slashx);
String morePath = extraPath.substring(slashx + 1); String morePath = extraPath.substring(slashx + 1);
if (!isBlank(morePath)) { // Slashes at the end of the path should be dropped because
// they don't make sense. TAP5-2663
while (morePath.endsWith("/"))
{
morePath = morePath.substring(0, morePath.length() - 1);
}
if (!isBlank(morePath))
{
resourcePath = baseFolder == null resourcePath = baseFolder == null
? morePath ? morePath
: baseFolder + "/" + morePath; : baseFolder + "/" + morePath;
} }
else { else {
// When we only have something which looks like a checksum but no ac tual path. // When we only have something which looks like a checksum but no ac tual path.
// For example, /assets/META-INF/ // For example, /assets/META-INF/
resourcePath = NON_EXISTING_RESOURCE; resourcePath = NON_EXISTING_RESOURCE;
} }
} }
 End of changes. 2 change blocks. 
2 lines changed or deleted 10 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)