import { Injectable } from '@angular/core' ; import { remote } from 'electron' ; import * as path from 'path' ; @ Injectable ( ) export class FileSystem { private _pathSeparator : string = '' ; constructor ( ) { this . _pathSeparator = path . sep ; } public combinePath ( pathPieces ) { if ( pathPieces == undefined || pathPieces . length === 0 ) { return '' ; } if ( pathPieces . length === 1 ) { return pathPieces [ 0 ] ; } const combinedPath = pathPieces . join ( this . _pathSeparator ) ; return combinedPath ; } public applicationDataDirectory ( ) { return remote . app . getPath ( 'userData' ) ; } }