|
Lines 1-5
Link Here
|
| 1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2000, 2006 IBM Corporation and others. |
2 |
* Copyright (c) 2000, 2007 IBM Corporation and others. |
| 3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
| 4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
|
Lines 7-16
Link Here
|
| 7 |
* |
7 |
* |
| 8 |
* Contributors: |
8 |
* Contributors: |
| 9 |
* IBM Corporation - initial API and implementation |
9 |
* IBM Corporation - initial API and implementation |
|
|
10 |
* Martin Oberhuber (Wind River) - [184433] get attributes from native lib |
| 10 |
*******************************************************************************/ |
11 |
*******************************************************************************/ |
| 11 |
package org.eclipse.core.internal.filesystem.local; |
12 |
package org.eclipse.core.internal.filesystem.local; |
| 12 |
|
13 |
|
| 13 |
import org.eclipse.core.filesystem.IFileInfo; |
14 |
import org.eclipse.core.filesystem.IFileInfo; |
|
|
15 |
import org.eclipse.core.filesystem.IFileSystem; |
| 14 |
import org.eclipse.core.filesystem.provider.FileInfo; |
16 |
import org.eclipse.core.filesystem.provider.FileInfo; |
| 15 |
import org.eclipse.core.internal.filesystem.Messages; |
17 |
import org.eclipse.core.internal.filesystem.Messages; |
| 16 |
import org.eclipse.core.internal.filesystem.Policy; |
18 |
import org.eclipse.core.internal.filesystem.Policy; |
|
Lines 36-41
Link Here
|
| 36 |
} |
38 |
} |
| 37 |
|
39 |
|
| 38 |
/** |
40 |
/** |
|
|
41 |
* Return the bit-mask of EFS attributes that this native |
| 42 |
* file system implementation supports. |
| 43 |
* <p> |
| 44 |
* This is an optional method: if it has not been compiled |
| 45 |
* into the native library, the client must catch the |
| 46 |
* resulting UnsatisfiedLinkError and handle attributes |
| 47 |
* as known by older version libraries. |
| 48 |
* </p> |
| 49 |
* @see IFileSystem#attributes() |
| 50 |
* @return an integer bit mask of attributes. |
| 51 |
*/ |
| 52 |
private static final native int nativeAttributes(); |
| 53 |
|
| 54 |
/** |
| 55 |
* Return the value that the native library thinks |
| 56 |
* {@link IFileSystem#attributes()} should return. |
| 57 |
* |
| 58 |
* Returns -1 when the native library has not been |
| 59 |
* loaded, or is a version that does not support |
| 60 |
* this investigation method yet. |
| 61 |
* |
| 62 |
* @return an positive value that is a bit-mask |
| 63 |
* suitable for use in {@link IFileSystem#attributes}, |
| 64 |
* or -1 if native attributes are not available. |
| 65 |
*/ |
| 66 |
public static int attributes() { |
| 67 |
try { |
| 68 |
return nativeAttributes(); |
| 69 |
} catch (UnsatisfiedLinkError e) { |
| 70 |
//older native implementations did not support this |
| 71 |
//call, so we cannot return supported attribute |
| 72 |
//information for them. |
| 73 |
return -1; |
| 74 |
} |
| 75 |
} |
| 76 |
|
| 77 |
/** |
| 39 |
* Copies file attributes from source to destination. The copyLastModified attribute |
78 |
* Copies file attributes from source to destination. The copyLastModified attribute |
| 40 |
* indicates whether the lastModified attribute should be copied. |
79 |
* indicates whether the lastModified attribute should be copied. |
| 41 |
* @param source |
80 |
* @param source |