I need to get the complete path of the "Library" private app folder for iOS app.
In Swift I would access that position with
let dir = try! FileManager.default.url(for: .libraryDirectory, in: .userDomainMask, appropriateFor: nil, create: true);
and then
let fileUrl = dir.appendingPathComponent(fileName).appendingPathExtension("json");
I read on StackOverflow that the kind of path is like
file:///var/mobile/Containers/Data/Application/strangenumberslike...EF22-EB33-4B65-9772-67ED7870E3E9/Library/
where the question did refer to "Document" (so the example could be wrong).
My need is getting the Library folder in that form in a cross-platform environment that cannot retrieve it directly, but it has the Document absolute path.
I think that it is just matter of substrings (JAVA), being said that the folder has the same "root".
Maybe
String root=documentPath.substring(0,documentPath.indexOf("Document"));
String libraryPath=root+"/Library";
Is this possible?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…