In a java method i am loading a path name into a string variable, not knowing whether it is a Unix or a Windows path name.
How can i programmatically check whether it is a Unix or a Windows path?
if path.contains(":") execute a Windows-related function
else execute a Unix-related function
won't work, because Unix path names can contain a ":" as far as i know. Same with "/" for Unix , because Windows path names can contain a "/" . So how could i do this best?
EDIT: I am loading directory names for remote machines, so i doubt i can use Use System.getProperty("os.name").
i was thinking about using Regex, but since i have no idea about regex in Java i have not considered that yet.