May 20, 201015 yr Hello folks! After days of trying to solve this, I need some advice: How can I get the name of a file from a full path name? It has to work on Mac and Windows paths and should be coded in Groovy so that I can include it into a script within Scriptmaster. Path format Mac OSX: /Users/Dekstop/scs1.png Path format Windows: C:Documents and SettingsUserNameMy Documentsscs1.png Thanks for your support! Martin
May 20, 201015 yr You create a Java File object File file = new File( "/Users/Dekstop/scs1.png" ); then: return file.getName() http://java.sun.com/j2se/1.4.2/docs/api/java/io/File.html#getName()
Create an account or sign in to comment