private String cleanupPath ( String fileName )
    {
        if ( fileName == null )
        {
            return null;
        }

        fileName = fileName.replace ( "\\", "/" ); // just in case we get windows paths
        fileName = fileName.replace ( "/+", "/" );

        if ( fileName.startsWith ( "./" ) )
        {
            return fileName;
        }
        if ( fileName.startsWith ( "/" ) )
        {
            return "." + fileName;
        }
        return "./" + fileName;
    }
private String cleanupPath ( String fileName )
    {
        if ( fileName == null )
        {
            return null;
        }

        fileName = fileName.replace ( "\\", "/" ); 
        fileName = fileName.replace ( "/+", "/" );

        if ( fileName.startsWith ( "./" ) )
        {
            return fileName;
        }
        if ( fileName.startsWith ( "/" ) )
        {
            return "." + fileName;
        }
        return "./" + fileName;
    }
private String cleanupPath ( String fileName ) { if ( fileName == null ) { return null ; } fileName = fileName . replace ( "\\" , "/" ) ; // just in case we get windows paths fileName = fileName . replace ( "/+" , "/" ) ; if ( fileName . startsWith ( "./" ) ) { return fileName ; } if ( fileName . startsWith ( "/" ) ) { return "." + fileName ; } return "./" + fileName ; }
clean up the path so that is looks like "./usr/local/file"
clean up the path so that is looks like . / usr / local / file