Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions resources/bundles/org.eclipse.core.filesystem/.classpath
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-25">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" output="bin" path="src"/>
<classpathentry kind="src" output="bin25" path="src25">
<attributes>
<attribute name="release" value="25"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="bin"/>
</classpath>
1 change: 1 addition & 0 deletions resources/bundles/org.eclipse.core.filesystem/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/bin25/
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.29.0,4.0.0)"
Export-Package: org.eclipse.core.filesystem;uses:="org.eclipse.core.runtime",
org.eclipse.core.filesystem.provider;uses:="org.eclipse.core.filesystem,org.eclipse.core.runtime",
org.eclipse.core.internal.filesystem;x-internal:=true,
org.eclipse.core.internal.filesystem.linux;x-internal:=true,
org.eclipse.core.internal.filesystem.local;x-internal:=true,
org.eclipse.core.internal.filesystem.local.unix;x-internal:=true
Bundle-Vendor: %providerName
Bundle-RequiredExecutionEnvironment: JavaSE-17
Bundle-ActivationPolicy: lazy
Automatic-Module-Name: org.eclipse.core.filesystem
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=17))"
Multi-Release: true
Import-Package: com.sun.jna;version="[5.14.0,6.0.0)",
com.sun.jna.platform.win32;version="[5.14.0,6.0.0)"
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Manifest-Version: 1.0
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=25))"
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
###############################################################################
source.. = src/
output.. = bin/
source.META-INF/versions/25/ = src25/
output.META-INF/versions/25/ = bin25/
bin.includes = META-INF/,\
.,\
plugin.xml,\
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*******************************************************************************
* Copyright (c) 2025 Eclipse contributors and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Eclipse contributors - initial API and implementation
*******************************************************************************/
package org.eclipse.core.internal.filesystem.linux;

/**
* Linux-specific file mode flags.
*
* <p>These are standard POSIX constants as defined in {@code <sys/stat.h>} and are
* identical across all Linux architectures. No Mac OS X specific flags
* (such as {@code UF_IMMUTABLE} or {@code SF_IMMUTABLE}) are present here since
* they are not supported on Linux.</p>
*
* @since 1.11.500
*/
public final class LinuxFileFlags {

/**
* Maximum number of characters in a file path including the null terminator.
*/
public static final int PATH_MAX = 4096;

/** Bitmask for the file type bitfields in {@code st_mode}. */
public static final int S_IFMT = 0xF000;

/** File type: symbolic link. */
public static final int S_IFLNK = 0xA000;

/** File type: directory. */
public static final int S_IFDIR = 0x4000;

/** Owner has read permission. */
public static final int S_IRUSR = 0x0100;

/** Owner has write permission. */
public static final int S_IWUSR = 0x0080;

/** Owner has execute permission. */
public static final int S_IXUSR = 0x0040;

/** Group has read permission. */
public static final int S_IRGRP = 0x0020;

/** Group has write permission. */
public static final int S_IWGRP = 0x0010;

/** Group has execute permission. */
public static final int S_IXGRP = 0x0008;

/** Others have read permission. */
public static final int S_IROTH = 0x0004;

/** Others have write permission. */
public static final int S_IWOTH = 0x0002;

/** Others have execute permission. */
public static final int S_IXOTH = 0x0001;

private LinuxFileFlags() {
// not instantiable
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*******************************************************************************
* Copyright (c) 2025 Eclipse contributors and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Eclipse contributors - initial API and implementation
*******************************************************************************/
package org.eclipse.core.internal.filesystem.linux;

import org.eclipse.core.filesystem.IFileInfo;
import org.eclipse.core.filesystem.provider.FileInfo;
import org.eclipse.core.internal.filesystem.local.NativeHandler;

/**
* A {@link NativeHandler} for Linux that uses the Java 25 Foreign Function &amp;
* Memory (FFM) API instead of JNI to access native file operations.
*
* <p>This handler delegates to {@link LinuxFileNatives}, which calls
* {@code statx(2)}, {@code chmod(2)} and {@code readlink(2)} directly via
* FFM downcall handles. No native shared library (.so) is required — the
* standard C library (libc) is used directly.</p>
*
* <p>Mac OS X specific code paths present in the old {@code UnixFileHandler}
* (chflags, UF_IMMUTABLE, SF_IMMUTABLE, CoreServices unicode conversion) are
* intentionally absent. This handler is exclusively for Linux.</p>
*
* @since 1.11.500
* @see LinuxFileNatives
*/
public class LinuxFileHandler extends NativeHandler {

@Override
public int getSupportedAttributes() {
return LinuxFileNatives.getSupportedAttributes();
}

@Override
public FileInfo fetchFileInfo(String fileName) {
return LinuxFileNatives.fetchFileInfo(fileName);
}

@Override
public boolean putFileInfo(String fileName, IFileInfo info, int options) {
return LinuxFileNatives.putFileInfo(fileName, info, options);
}

}
Loading
Loading