Skip to content

Introduction

JitPack License Telegram

kappdirs is an appdirs implementation written in pure Kotlin. It has a similar implementation of harawata's appdirs and inspired by that project.

Features

  • Supporting Mac OS X, Unix based or inspired systems including most popular Linux distributions and Windows
  • A standard API and a DSL API that makes it quite easier

Installation

You can get installation instruction from Jitpack.

A Brief Introduction

You can grab an instance of AppDirs as below:

val appDirs: AppDirs = AppDirsFactory.getInstance()
val appData: Path = appDirs.getUserDataDir("myApp", "0.1.0", "myName")

AppDirsFactory::getInstance will create an AppDirs object based on your operating system and then you can use one of its methods to get Path instance.

Note

An AppDirs instance is created lazily, which means it is created by AppDirsFactory only once and when getInstance called and later on you get the reference to the same object.