public String appendFileSeparator ( String path ) { if ( null == path ) { return File . separator ; } // add "/" prefix if ( ! path . startsWith ( StringPool . SLASH ) && ! path . startsWith ( StringPool . BACK_SLASH ) ) { path = File . separator + path ; } // add "/" postfix if ( ! path . endsWith ( StringPool . SLASH ) && ! path . endsWith ( StringPool . BACK_SLASH ) ) { path = path + File . separator ; } return path ; }
Add File Separator