Skip to content

Commit

Permalink
Improved debug log
Browse files Browse the repository at this point in the history
  • Loading branch information
phax committed Jan 3, 2025
1 parent 36d8a28 commit aad72d9
Showing 1 changed file with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,18 +104,17 @@ private static ClassPathResource _resolveClassPathResource (final String sSystem
final File aBaseFile = new File (sBaseURIWithoutPrefix).getParentFile ();

// Concatenate the path with the URI to search
final String sNewPath = FilenameHelper.getCleanPath (aBaseFile == null ? sSystemId : aBaseFile.getPath () +
'/' +
sSystemId);
final String sNewPath = FilenameHelper.getCleanPath (aBaseFile == null ? sSystemId
: aBaseFile.getPath () + '/' + sSystemId);

final ClassPathResource ret = new ClassPathResource (sNewPath, aClassLoader);
CONDLOG.info ( () -> " [ClassPath] resolved base + system to " + ret);
return ret;
}

@Nonnull
private static URLResource _resolveJarFileResource (@Nonnull final String sSystemId, @Nonnull final String sBaseURI)
throws MalformedURLException
private static URLResource _resolveJarFileResource (@Nonnull final String sSystemId,
@Nonnull final String sBaseURI) throws MalformedURLException
{
// Base URI is inside a jar file? Skip the JAR file
// See issue #8 - use lastIndexOf here
Expand All @@ -140,9 +139,8 @@ private static URLResource _resolveJarFileResource (@Nonnull final String sSyste
final File aBaseFile = new File (sBasePath).getParentFile ();

// Concatenate the path with the URI to search
final String sNewPath = FilenameHelper.getCleanPath (aBaseFile == null ? sSystemId : aBaseFile.getPath () +
'/' +
sSystemId);
final String sNewPath = FilenameHelper.getCleanPath (aBaseFile == null ? sSystemId
: aBaseFile.getPath () + '/' + sSystemId);

final String sAggregatedPath;
if (sPrefix.endsWith ("/") && sNewPath.startsWith ("/"))
Expand All @@ -158,8 +156,8 @@ private static URLResource _resolveJarFileResource (@Nonnull final String sSyste
}

@Nonnull
private static URLResource _resolveURLResource (final String sSystemId, @Nonnull final URL aBaseURL)
throws MalformedURLException
private static URLResource _resolveURLResource (final String sSystemId,
@Nonnull final URL aBaseURL) throws MalformedURLException
{
// Take only the path
String sBasePath = aBaseURL.getPath ();
Expand Down Expand Up @@ -228,11 +226,11 @@ public static IReadableResource getResolvedResource (@Nullable final String sSys
throw new IllegalArgumentException ("Both systemID and baseURI are null!");

if (LOGGER.isDebugEnabled ())
LOGGER.debug ("Trying to resolve resource " +
LOGGER.debug ("Trying to resolve resource '" +
sSystemId +
" from base " +
"' from base '" +
sBaseURI +
(aClassLoader == null ? "" : " with ClassLoader " + aClassLoader));
(aClassLoader == null ? "'" : "' with ClassLoader " + aClassLoader));

CONDLOG.info ( () -> "doStandardResourceResolving ('" + sSystemId + "', '" + sBaseURI + "', " + aClassLoader + ")");

Expand Down

0 comments on commit aad72d9

Please sign in to comment.