equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
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 |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
177 } |
177 } |
178 } |
178 } |
179 } |
179 } |
180 |
180 |
181 // use this message when throwing exceptions |
181 // use this message when throwing exceptions |
182 String getPathForExecptionMessage() { |
182 String getPathForExceptionMessage() { |
183 return toString(); |
183 return toString(); |
184 } |
184 } |
185 |
185 |
186 // use this path for permission checks |
186 // use this path for permission checks |
187 String getPathForPermissionCheck() { |
187 String getPathForPermissionCheck() { |
778 // HACK: EINVAL instead of ELOOP on Solaris 10 prior to u4 (see 6460380) |
778 // HACK: EINVAL instead of ELOOP on Solaris 10 prior to u4 (see 6460380) |
779 if (getFileSystem().isSolaris() && x.errno() == EINVAL) |
779 if (getFileSystem().isSolaris() && x.errno() == EINVAL) |
780 x.setError(ELOOP); |
780 x.setError(ELOOP); |
781 |
781 |
782 if (x.errno() == ELOOP) |
782 if (x.errno() == ELOOP) |
783 throw new FileSystemException(getPathForExecptionMessage(), null, |
783 throw new FileSystemException(getPathForExceptionMessage(), null, |
784 x.getMessage() + " or unable to access attributes of symbolic link"); |
784 x.getMessage() + " or unable to access attributes of symbolic link"); |
785 |
785 |
786 x.rethrowAsIOException(this); |
786 x.rethrowAsIOException(this); |
787 return -1; // keep compile happy |
787 return -1; // keep compile happy |
788 } |
788 } |