15 lines
311 B
Python
Raw Normal View History

2024-05-25 18:45:07 +02:00
from pathlib import Path
from jpype import JConversion, JClass
@JConversion("java.lang.String", instanceof=Path)
def pathToString(cls: JClass, path: Path):
return cls(path.resolve().__str__())
@JConversion("java.io.File", instanceof=Path)
def pathToFile(cls: JClass, path: Path):
return cls(path)