package com.epson.memcardacc;

import java.util.LinkedList;

public class DirectoryCache {
    LimitedHashMap<String, LinkedList<CifsFileInfo>> mCacheHashMap = new LimitedHashMap<>();
    CifsAccess mCifsAccess;

    public void setCifsAccess(CifsAccess cifsAccess) {
        mCifsAccess = cifsAccess;
    }

    public LinkedList<CifsFileInfo> getFileList(String str) {
        LinkedList<CifsFileInfo> linkedList = (LinkedList) mCacheHashMap.get(str);
        if (linkedList != null) {
            return linkedList;
        }
        LinkedList<CifsFileInfo> fileList = mCifsAccess.getFileList(str);
        if (fileList != null) {
            mCacheHashMap.put(str, fileList);
        }
        return fileList;
    }
}
