@@ -476,12 +476,6 @@ private URI createURI(Connection connection, String folderPath) throws URISyntax
476476
477477 StringBuilder path = new StringBuilder (uri .getPath () == null || "" .equals (uri .getPath ()) ? "/" : uri .getPath ());
478478
479- //add the controller name
480- String controller = getControllerName ();
481- if (controller .charAt (0 ) != '/' && path .charAt (path .length () - 1 ) != '/' )
482- path .append ('/' );
483- path .append (controller );
484-
485479 //add the folderPath (if any)
486480 if (null != folderPath && folderPath .length () > 0 )
487481 {
@@ -491,11 +485,25 @@ private URI createURI(Connection connection, String folderPath) throws URISyntax
491485 path .append (folderPathNormalized );
492486 }
493487
488+ if (path .charAt (path .length () - 1 ) != '/' )
489+ path .append ('/' );
490+
491+ //add the controller name
492+ String controller = getControllerName ();
493+ //for now, strip leading /. TODO: For next major release, throw
494+ if (controller .charAt (0 ) == '/' )
495+ controller = controller .substring (1 );
496+ //for now, strip trailing /. TODO: For next major release, throw
497+ if (controller .charAt (controller .length () - 1 ) == '/' )
498+ controller = controller .substring (0 , controller .length () - 1 );
499+ path .append (controller );
500+
494501 //add the action name + ".api"
495502 String actionName = getActionName ();
496- if (actionName .charAt (0 ) != '/' && path .charAt (path .length () - 1 ) != '/' )
497- path .append ('/' );
498- path .append (actionName );
503+ //for now, strip leading /. TODO: For next major release, throw
504+ if (actionName .charAt (0 ) == '/' )
505+ actionName = actionName .substring (1 );
506+ path .append ("-" ).append (actionName );
499507 if (!actionName .endsWith (".api" ))
500508 path .append (".api" );
501509
@@ -573,5 +581,4 @@ public void setRequiredVersion(double requiredVersion)
573581 {
574582 _requiredVersion = requiredVersion ;
575583 }
576-
577584}
0 commit comments