Fix bad pathname settings.

This commit is contained in:
Christian P. MOMON 2013-08-30 18:26:25 +02:00
parent 5912bf9079
commit 9daeb06fc4

View file

@ -197,12 +197,18 @@ public class URLPresenter extends StringPresenter
public void setSource(final String source)
{
//
URL url;
if (source == null)
{
url = null;
this.source = null;
this.sourcePathname = null;
this.sourceTime = 0;
super.setSource(null);
}
else if (source.matches(".+://.+"))
else
{
//
URL url;
if (source.matches(".+://.+"))
{
try
{
@ -221,7 +227,21 @@ public class URLPresenter extends StringPresenter
}
//
setSource(url);
if (url == null)
{
this.source = null;
this.sourcePathname = source;
this.sourceTime = 0;
super.setSource(null);
}
else
{
this.source = url;
this.sourcePathname = source;
this.sourceTime = 0;
super.setSource(null);
}
}
}
/**
@ -282,7 +302,7 @@ public class URLPresenter extends StringPresenter
//
if (this.source == null)
{
String errorMessage = "source not defined";
String errorMessage = "source not defined (" + this.sourcePathname + ")";
logger.error(errorMessage);
throw new NullPointerException(errorMessage);
}