1 /* 2 * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 #include "FileSystemSupport_md.h" 27 28 /** 29 * Return the local filesystem's path-separator character. 30 */ 31 char pathSeparator(); 32 33 /** 34 * Compare two filenames represent and tell if they represent the same file 35 * or not. 36 */ 37 int filenameStrcmp(const char* s1, const char* s2); 38 39 /** 40 * Post-process the given URI path string if necessary. This is used on 41 * win32, e.g., to transform "/c:/foo" into "c:/foo". The path string 42 * still has slash separators; code in the File class will translate them 43 * after this method returns. 44 */ 45 char* fromURIPath(const char* path); 46 47 /** 48 * Return the basen path of the given pathname. If the string is already 49 * the base path then it is simply returned. 50 */ 51 char* basePath(const char* path); 52 53 /** 54 * Convert the given pathname string to normal form. If the string is 55 * already in normal form then it is simply returned. 56 */ 57 char* normalize(const char* path); 58 59 /** 60 * Tell whether or not the given abstract pathname is absolute. 61 */ 62 int isAbsolute(const char * path); 63 64 /** 65 * Resolve the child pathname string against the parent. 66 */ 67 char* resolve(const char* parent, const char* child); 68 69 /** 70 * Convert a pathname to canonical form. 71 * -- compiled in from src/<platform>/native/java/io/canonicalize_md.c 72 */ 73 int canonicalize(char *original, char *resolved, int len); 74