AccessDeniedError
means you don't have permission to write to that folder. This is not coming from better-file but from the JDK std lib itself (in the case of I/O from the OS itself)
.store
to specify the compression method for an individual ZIP file entry, and set it to STORED.
cannonicalFile
is expressed like this:
def canonicalFile: File =
toJava.getCanonicalFile.toScala
hi Guys
when I give a config string like below
File("~/some/directory")
it outputs;
in windows: C:\Users\myuser\projects\myproject\~\some\directory
in linux : /home/myuser/projects/myproject/~/some/directory
I would expect it to output;
in windows: C:\Users\myuser\some\directory
in linux: /home/myuser/some/directory
but File.home
is pointing to correct directoryprojects/myproject
is the classpath of the running application
am I doing something wrong?
@pathikrit thanks
I needed to implement something for my usage below
val PathRegex = """^(?:\~\/)(\.?.*)""".r
implicit class FileAugmentations(file: String) {
def toFile: File = file match {
case PathRegex(paths) =>
File.home / paths
case absolute =>
File(absolute)
}
}
issue is I will be getting the strings from config files so cannot use code until I reason with the string