public static File toSLDFile(final File file){
  final String path=file.getAbsolutePath();
  final String base=path.substring(0,path.length() - 4);
  String newPath=base + ".sld";
  File sld=new File(newPath);
  if (sld.exists()) {
    return sld;
  }
  newPath=base + ".SLD";
  sld=new File(newPath);
  if (sld.exists()) {
    return sld;
  }
  return null;
}

public static File toSLDFile ( final File file ) { final String path = file . getAbsolutePath ( ) ; final String base = path . substring ( 0 , path . length ( ) - 4 ) ; String newPath = base + ".sld" ; File sld = new File ( newPath ) ; if ( sld . exists ( ) ) { return sld ; } newPath = base + ".SLD" ; sld = new File ( newPath ) ; if ( sld . exists ( ) ) { return sld ; } return null ; }
figure out if a valid sld file is available .
