import typing

import java
import java.chaquopy
import java.io
import java.lang
import java.nio
import java.security
import java.time
import java.util
import java.util.concurrent

class AclEntry(java.lang.Object):
    def equals(self, ob: java.lang.Object | int | bool | float | str, /) -> bool: ...
    def flags(self) -> java.util.Set[AclEntryFlag]: ...
    def hashCode(self) -> int: ...
    @typing.overload
    @staticmethod
    def newBuilder() -> AclEntry.Builder: ...
    @typing.overload
    @staticmethod
    def newBuilder(entry: AclEntry, /) -> AclEntry.Builder: ...
    def permissions(self) -> java.util.Set[AclEntryPermission]: ...
    def principal(self) -> UserPrincipal: ...
    def toString(self) -> str: ...
    def type(self) -> AclEntryType: ...

    class Builder(java.lang.Object):
        def build(self) -> AclEntry: ...
        @typing.overload
        def setFlags(self, flags: java.util.Set[AclEntryFlag], /) -> AclEntry.Builder: ...
        @typing.overload
        def setFlags(self, *flags: AclEntryFlag) -> AclEntry.Builder: ...
        @typing.overload
        def setPermissions(self, perms: java.util.Set[AclEntryPermission], /) -> AclEntry.Builder: ...
        @typing.overload
        def setPermissions(self, *perms: AclEntryPermission) -> AclEntry.Builder: ...
        def setPrincipal(self, who: UserPrincipal, /) -> AclEntry.Builder: ...
        def setType(self, type: AclEntryType, /) -> AclEntry.Builder: ...

class AclEntryFlag(java.lang.Enum[AclEntryFlag]):
    DIRECTORY_INHERIT: typing.ClassVar[AclEntryFlag] = ...
    FILE_INHERIT: typing.ClassVar[AclEntryFlag] = ...
    INHERIT_ONLY: typing.ClassVar[AclEntryFlag] = ...
    NO_PROPAGATE_INHERIT: typing.ClassVar[AclEntryFlag] = ...
    @staticmethod
    def valueOf(name: str | java.lang.String, /) -> AclEntryFlag: ...
    @staticmethod
    def values() -> java.chaquopy.JavaArray[AclEntryFlag]: ...

class AclEntryPermission(java.lang.Enum[AclEntryPermission]):
    ADD_FILE: typing.ClassVar[AclEntryPermission] = ...
    ADD_SUBDIRECTORY: typing.ClassVar[AclEntryPermission] = ...
    APPEND_DATA: typing.ClassVar[AclEntryPermission] = ...
    DELETE: typing.ClassVar[AclEntryPermission] = ...
    DELETE_CHILD: typing.ClassVar[AclEntryPermission] = ...
    EXECUTE: typing.ClassVar[AclEntryPermission] = ...
    LIST_DIRECTORY: typing.ClassVar[AclEntryPermission] = ...
    READ_ACL: typing.ClassVar[AclEntryPermission] = ...
    READ_ATTRIBUTES: typing.ClassVar[AclEntryPermission] = ...
    READ_DATA: typing.ClassVar[AclEntryPermission] = ...
    READ_NAMED_ATTRS: typing.ClassVar[AclEntryPermission] = ...
    SYNCHRONIZE: typing.ClassVar[AclEntryPermission] = ...
    WRITE_ACL: typing.ClassVar[AclEntryPermission] = ...
    WRITE_ATTRIBUTES: typing.ClassVar[AclEntryPermission] = ...
    WRITE_DATA: typing.ClassVar[AclEntryPermission] = ...
    WRITE_NAMED_ATTRS: typing.ClassVar[AclEntryPermission] = ...
    WRITE_OWNER: typing.ClassVar[AclEntryPermission] = ...
    @staticmethod
    def valueOf(name: str | java.lang.String, /) -> AclEntryPermission: ...
    @staticmethod
    def values() -> java.chaquopy.JavaArray[AclEntryPermission]: ...

class AclEntryType(java.lang.Enum[AclEntryType]):
    ALARM: typing.ClassVar[AclEntryType] = ...
    ALLOW: typing.ClassVar[AclEntryType] = ...
    AUDIT: typing.ClassVar[AclEntryType] = ...
    DENY: typing.ClassVar[AclEntryType] = ...
    @staticmethod
    def valueOf(name: str | java.lang.String, /) -> AclEntryType: ...
    @staticmethod
    def values() -> java.chaquopy.JavaArray[AclEntryType]: ...

class AclFileAttributeView(FileOwnerAttributeView):
    def getAcl(self) -> java.util.List[AclEntry]: ...
    def name(self) -> str: ...
    def setAcl(self, arg1: java.util.List[AclEntry], /) -> None: ...

class AttributeView(java.lang.Object):
    def name(self) -> str: ...

class BasicFileAttributeView(FileAttributeView):
    def name(self) -> str: ...
    def readAttributes(self) -> BasicFileAttributes: ...
    def setTimes(self, arg1: FileTime, arg2: FileTime, arg3: FileTime, /) -> None: ...

class BasicFileAttributes(java.lang.Object):
    def creationTime(self) -> FileTime: ...
    def fileKey(self) -> java.lang.Object: ...
    def isDirectory(self) -> bool: ...
    def isOther(self) -> bool: ...
    def isRegularFile(self) -> bool: ...
    def isSymbolicLink(self) -> bool: ...
    def lastAccessTime(self) -> FileTime: ...
    def lastModifiedTime(self) -> FileTime: ...
    def size(self) -> int: ...

class DosFileAttributeView(BasicFileAttributeView):
    def name(self) -> str: ...
    def readAttributes(self) -> DosFileAttributes: ...
    def setArchive(self, arg1: bool | java.jboolean | java.lang.Boolean, /) -> None: ...
    def setHidden(self, arg1: bool | java.jboolean | java.lang.Boolean, /) -> None: ...
    def setReadOnly(self, arg1: bool | java.jboolean | java.lang.Boolean, /) -> None: ...
    def setSystem(self, arg1: bool | java.jboolean | java.lang.Boolean, /) -> None: ...

class DosFileAttributes(BasicFileAttributes):
    def isArchive(self) -> bool: ...
    def isHidden(self) -> bool: ...
    def isReadOnly(self) -> bool: ...
    def isSystem(self) -> bool: ...

_FileAttribute__T = typing.TypeVar('_FileAttribute__T')  # <T>
class FileAttribute(java.lang.Object, typing.Generic[_FileAttribute__T]):
    def name(self) -> str: ...
    def value(self) -> _FileAttribute__T: ...

class FileAttributeView(AttributeView): ...

class FileOwnerAttributeView(FileAttributeView):
    def getOwner(self) -> UserPrincipal: ...
    def name(self) -> str: ...
    def setOwner(self, arg1: UserPrincipal, /) -> None: ...

class FileStoreAttributeView(AttributeView): ...

class FileTime(java.lang.Comparable[FileTime]):
    def compareTo(self, other: FileTime, /) -> int: ...
    def equals(self, obj: java.lang.Object | int | bool | float | str, /) -> bool: ...
    @staticmethod
    def fromMillis(value: int | java.jlong | java.lang.Long, /) -> FileTime: ...
    @typing.overload
    @staticmethod
    def from_(instant: java.time.Instant, /) -> FileTime: ...
    @typing.overload
    @staticmethod
    def from_(value: int | java.jlong | java.lang.Long, unit: java.util.concurrent.TimeUnit, /) -> FileTime: ...
    def hashCode(self) -> int: ...
    def to(self, unit: java.util.concurrent.TimeUnit, /) -> int: ...
    def toInstant(self) -> java.time.Instant: ...
    def toMillis(self) -> int: ...
    def toString(self) -> str: ...

class GroupPrincipal(UserPrincipal): ...

class PosixFileAttributeView(BasicFileAttributeView, FileOwnerAttributeView):
    def name(self) -> str: ...
    def readAttributes(self) -> PosixFileAttributes: ...
    def setGroup(self, arg1: GroupPrincipal, /) -> None: ...
    def setPermissions(self, arg1: java.util.Set[PosixFilePermission], /) -> None: ...

class PosixFileAttributes(BasicFileAttributes):
    def group(self) -> GroupPrincipal: ...
    def owner(self) -> UserPrincipal: ...
    def permissions(self) -> java.util.Set[PosixFilePermission]: ...

class PosixFilePermission(java.lang.Enum[PosixFilePermission]):
    GROUP_EXECUTE: typing.ClassVar[PosixFilePermission] = ...
    GROUP_READ: typing.ClassVar[PosixFilePermission] = ...
    GROUP_WRITE: typing.ClassVar[PosixFilePermission] = ...
    OTHERS_EXECUTE: typing.ClassVar[PosixFilePermission] = ...
    OTHERS_READ: typing.ClassVar[PosixFilePermission] = ...
    OTHERS_WRITE: typing.ClassVar[PosixFilePermission] = ...
    OWNER_EXECUTE: typing.ClassVar[PosixFilePermission] = ...
    OWNER_READ: typing.ClassVar[PosixFilePermission] = ...
    OWNER_WRITE: typing.ClassVar[PosixFilePermission] = ...
    @staticmethod
    def valueOf(name: str | java.lang.String, /) -> PosixFilePermission: ...
    @staticmethod
    def values() -> java.chaquopy.JavaArray[PosixFilePermission]: ...

class PosixFilePermissions(java.lang.Object):
    @staticmethod
    def asFileAttribute(perms: java.util.Set[PosixFilePermission], /) -> FileAttribute[java.util.Set[PosixFilePermission]]: ...
    @staticmethod
    def fromString(perms: str | java.lang.String, /) -> java.util.Set[PosixFilePermission]: ...
    @staticmethod
    def toString(perms: java.util.Set[PosixFilePermission], /) -> str: ...

class UserDefinedFileAttributeView(FileAttributeView):
    def delete(self, arg1: str | java.lang.String, /) -> None: ...
    def list(self) -> java.util.List[java.lang.String]: ...
    def name(self) -> str: ...
    def read(self, arg1: str | java.lang.String, arg2: java.nio.ByteBuffer, /) -> int: ...
    def size(self, arg1: str | java.lang.String, /) -> int: ...
    def write(self, arg1: str | java.lang.String, arg2: java.nio.ByteBuffer, /) -> int: ...

class UserPrincipal(java.security.Principal): ...

class UserPrincipalLookupService(java.lang.Object):
    def __init__(self) -> None: ...
    def lookupPrincipalByGroupName(self, arg1: str | java.lang.String, /) -> GroupPrincipal: ...
    def lookupPrincipalByName(self, arg1: str | java.lang.String, /) -> UserPrincipal: ...

class UserPrincipalNotFoundException(java.io.IOException):
    def __init__(self, name: str | java.lang.String, /) -> None: ...
    def getName(self) -> str: ...
