Compile error with byte[]

I tried to modify path here

String defineDir(String path){
if(path.substring(0,2)=="//"){
return "file:///storage/emulated/0/AppInventor/assets/"+path.substring(3,path.length());
}else{
if(path.substring(0,1)=="/"){
return "file:///mnt/sdcard"+path;
}else {
if (path.substring(0, 7) == "file:///" {
return path;
}
else return path;
}
}
}

but it can't compare substring with "/" or "//" I don't know why !