2021-05-31 16:22:30 +00:00

32 lines
1.5 KiB
Go

//
// Copyright 2020 FoxyUtils ehf. All rights reserved.
//
// This is a commercial product and requires a license to operate.
// A trial license can be obtained at https://unidoc.io
//
// DO NOT EDIT: generated by unitwist Go source code obfuscator.
//
// Use of this source code is governed by the UniDoc End User License Agreement
// terms that can be accessed at https://unidoc.io/eula/
// Package diskstore implements tempStorage interface
// by using disk as a storage
package diskstore ;import (_fa "github.com/unidoc/unioffice/common/tempstorage";_b "io/ioutil";_g "os";_e "strings";);
// SetAsStorage sets temp storage as a disk storage
func SetAsStorage (){_a :=diskStorage {};_fa .SetAsStorage (&_a )};
// Open opens file from disk according to a path
func (_ag diskStorage )Open (path string )(_fa .File ,error ){return _g .Open (path )};type diskStorage struct{};
// RemoveAll removes all files in the directory
func (_ef diskStorage )RemoveAll (dir string )error {if _e .HasPrefix (dir ,_g .TempDir ()){return _g .RemoveAll (dir );};return nil ;};
// TempFile creates a new temp file by calling ioutil TempFile
func (_ae diskStorage )TempFile (dir ,pattern string )(_fa .File ,error ){return _b .TempFile (dir ,pattern );};
// TempFile creates a new temp directory by calling ioutil TempDir
func (_fd diskStorage )TempDir (pattern string )(string ,error ){return _b .TempDir ("",pattern )};
// Add is not applicable in the diskstore implementation
func (_bb diskStorage )Add (path string )error {return nil };