/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Linux implementation of UserDefinedFileAttributeView using extended attributes.
*/
{
// namespace for extended user attributes
// maximum bytes in extended attribute name (includes namespace)
throw new NullPointerException("'name' is null");
}
return bytes;
}
// Parses buffer as array of NULL-terminated C strings.
int start = 0;
int pos = 0;
if (s.startsWith(USER_NAMESPACE)) {
}
}
pos++;
}
return list;
}
private final boolean followLinks;
this.followLinks = followLinks;
}
try {
int size = 1024;
for (;;) {
try {
} catch (UnixException x) {
// allocate larger buffer if required
size *= 2;
continue;
}
null, "Unable to get list of extended attributes: " +
x.getMessage());
}
}
} finally {
}
}
try {
// fgetxattr returns size if called with size==0
} catch (UnixException x) {
"': " + x.getMessage());
} finally {
}
}
if (dst.isReadOnly())
throw new IllegalArgumentException("Read-only buffer");
long address;
} else {
// substitute with native buffer
}
try {
try {
// if remaining is zero then fgetxattr returns the size
if (rem == 0) {
if (n > 0)
throw new UnixException(ERANGE);
return 0;
}
// copy from buffer into backing array if necessary
}
return n;
} catch (UnixException x) {
"Insufficient space in buffer" : x.getMessage();
} finally {
}
} finally {
}
}
long address;
} else {
// substitute with native buffer
// copy from backing array into buffer
} else {
// backing array not accessible so transfer via temporary array
}
}
try {
try {
return rem;
} catch (UnixException x) {
x.getMessage());
} finally {
}
} finally {
}
}
try {
} catch (UnixException x) {
} finally {
}
}
/**
*
* @param ofd
* file descriptor for source file
* @param nfd
* file descriptor for target file
*/
try {
// call flistxattr to get list of extended attributes.
int size = 1024;
for (;;) {
try {
break;
} catch (UnixException x) {
// allocate larger buffer if required
size *= 2;
continue;
}
// unable to get list of attributes
return;
}
}
// parse buffer as array of NULL-terminated C strings.
int start = 0;
int pos = 0;
// extract attribute name and copy attribute to target.
// FIXME: We can avoid needless copying by using address+pos
// as the address of the name.
try {
} catch (UnixException ignore) {
// ignore
}
}
pos++;
}
} finally {
}
}
throws UnixException
{
try {
} finally {
}
}
}