system/src/sc/layer/LayeredSystem.java
private String findLayerDefFile(String layerDir, String layerPathName, String relDir, String layerPrefix) {
      String layerFileName;
      String layerTypeName;

      layerDir = LayerUtil.mapLayerDirName(layerDir);

      if (layerPathName.equals(".")) {
         layerFileName = System.getProperty("user.dir");
         layerTypeName = FileUtil.getFileName(layerFileName);
      }
      else if (FileUtil.isAbsolutePath(layerPathName)) {
         return null;
      }
      else {
         // Trim trailing slashes
         while (layerPathName.endsWith(FileUtil.FILE_SEPARATOR))
            layerPathName = layerPathName.substring(0, layerPathName.length()-1);

         layerTypeName = CTypeUtil.prefixPath(layerPrefix, layerPathName);
         String layerPathNamePath;
         layerFileName = FileUtil.concat(layerDir, layerPathNamePath = LayerUtil.fixLayerPathName(layerPathName));
      }

      String layerBaseName = CTypeUtil.getClassName(layerTypeName) + "." + SCLanguage.STRATACODE_SUFFIX;

      String layerDefFile = FileUtil.concat(layerFileName, layerBaseName);

      if (new File(layerDefFile).canRead())
         return layerDefFile;
      return null;
   }
/** This uses the same algorithm as findLayer but only computes and validates the layerDefFile's path name. */
This uses the same algorithm as findLayer but only computes and validates the layerDefFile's path name.
This uses the same algorithm as findLayer but only computes and validates the layerDefFile ' s path name .
private String findLayerDefFile(String layerDir, String layerPathName, String relDir, String layerPrefix) {
      String layerFileName;
      String layerTypeName;
      layerDir = LayerUtil.mapLayerDirName(layerDir);
      if (layerPathName.equals(".")) {
         layerFileName = System.getProperty("user.dir");
         layerTypeName = FileUtil.getFileName(layerFileName);
      }
      else if (FileUtil.isAbsolutePath(layerPathName)) {
         return null;
      }
      else {
         while (layerPathName.endsWith(FileUtil.FILE_SEPARATOR))
            layerPathName = layerPathName.substring(0, layerPathName.length()-1);
         layerTypeName = CTypeUtil.prefixPath(layerPrefix, layerPathName);
         String layerPathNamePath;
         layerFileName = FileUtil.concat(layerDir, layerPathNamePath = LayerUtil.fixLayerPathName(layerPathName));
      }
      String layerBaseName = CTypeUtil.getClassName(layerTypeName) + "." + SCLanguage.STRATACODE_SUFFIX;
      String layerDefFile = FileUtil.concat(layerFileName, layerBaseName);
      if (new File(layerDefFile).canRead())
         return layerDefFile;
      return null;
   }
private String findLayerDefFile ( String layerDir , String layerPathName , String relDir , String layerPrefix ) { String layerFileName ; String layerTypeName ; layerDir = LayerUtil . mapLayerDirName ( layerDir ) ; if ( layerPathName . equals ( "." ) ) { layerFileName = System . getProperty ( "user.dir" ) ; layerTypeName = FileUtil . getFileName ( layerFileName ) ; } else if ( FileUtil . isAbsolutePath ( layerPathName ) ) { return null ; } else { while ( layerPathName . endsWith ( FileUtil . FILE_SEPARATOR ) ) layerPathName = layerPathName . substring ( 0 , layerPathName . length ( ) - 1 ) ; layerTypeName = CTypeUtil . prefixPath ( layerPrefix , layerPathName ) ; String layerPathNamePath ; layerFileName = FileUtil . concat ( layerDir , layerPathNamePath = LayerUtil . fixLayerPathName ( layerPathName ) ) ; } String layerBaseName = CTypeUtil . getClassName ( layerTypeName ) + "." + SCLanguage . STRATACODE_SUFFIX ; String layerDefFile = FileUtil . concat ( layerFileName , layerBaseName ) ; if ( new File ( layerDefFile ) . canRead ( ) ) return layerDefFile ; return null ; }
This uses the same algorithm as findLayer but only computes and validates the layerDefFile's path name.
This uses the same algorithm as findLayer but only computes and validates the layerDefFile ' s path name .
// Trim trailing slashes