Skip to content

Commit

Permalink
fix non-filepath entries
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanPreibisch committed Oct 19, 2024
1 parent 55d1afb commit 117624d
Showing 1 changed file with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,15 @@ public boolean queryXML(
// try to parse the file anyways
boolean success;

success = tryParsing( xmlURI.equals( "define" ) ? URI.create( "define" ) : URITools.toURI( xmlURI ), true );
URI uri;

if ( xmlURI.trim().length() == 0 || xmlURI.trim().toLowerCase().equals( "beads" ) ||
xmlURI.trim().toLowerCase().equals( "fractal" ) || xmlURI.trim().toLowerCase().equals( "define" ) )
uri = URI.create( xmlURI );
else
uri = URITools.toURI( xmlURI );

success = tryParsing( uri, true );

if ( buttonText != null && xmlURI.toLowerCase().equals( "define" ) && buttonText.get( 0 ).equals( "Define a new dataset" ) )
{
Expand Down Expand Up @@ -896,7 +904,15 @@ public void textValueChanged( final TextEvent t )
// try parsing if it ends with XML
try
{
tryParsing( URITools.toURI( xmlFilename ), false );
URI uri;

if ( xmlFilename.trim().length() == 0 || xmlFilename.trim().toLowerCase().equals( "beads" ) ||
xmlFilename.trim().toLowerCase().equals( "fractal" ) || xmlFilename.trim().toLowerCase().equals( "define" ) )
uri = URI.create( xmlFilename );
else
uri = URITools.toURI( xmlFilename );

tryParsing( uri, false );
}
catch (Exception e)
{
Expand Down

0 comments on commit 117624d

Please sign in to comment.