Tabnine Logo
LruDiskCache.getKey
Code IndexAdd Tabnine to your IDE (free)

How to use
getKey
method
in
com.nostra13.universalimageloader.cache.disc.impl.ext.LruDiskCache

Best Java code snippets using com.nostra13.universalimageloader.cache.disc.impl.ext.LruDiskCache.getKey (Showing top 16 results out of 315)

origin: nostra13/Android-Universal-Image-Loader

@Override
public boolean remove(String imageUri) {
  try {
    return cache.remove(getKey(imageUri));
  } catch (IOException e) {
    L.e(e);
    return false;
  }
}
origin: nostra13/Android-Universal-Image-Loader

@Override
public boolean save(String imageUri, Bitmap bitmap) throws IOException {
  DiskLruCache.Editor editor = cache.edit(getKey(imageUri));
  if (editor == null) {
    return false;
  }
  OutputStream os = new BufferedOutputStream(editor.newOutputStream(0), bufferSize);
  boolean savedSuccessfully = false;
  try {
    savedSuccessfully = bitmap.compress(compressFormat, compressQuality, os);
  } finally {
    IoUtils.closeSilently(os);
  }
  if (savedSuccessfully) {
    editor.commit();
  } else {
    editor.abort();
  }
  return savedSuccessfully;
}
origin: nostra13/Android-Universal-Image-Loader

@Override
public File get(String imageUri) {
  DiskLruCache.Snapshot snapshot = null;
  try {
    snapshot = cache.get(getKey(imageUri));
    return snapshot == null ? null : snapshot.getFile(0);
  } catch (IOException e) {
    L.e(e);
    return null;
  } finally {
    if (snapshot != null) {
      snapshot.close();
    }
  }
}
origin: nostra13/Android-Universal-Image-Loader

@Override
public boolean save(String imageUri, InputStream imageStream, IoUtils.CopyListener listener) throws IOException {
  DiskLruCache.Editor editor = cache.edit(getKey(imageUri));
  if (editor == null) {
    return false;
  }
  OutputStream os = new BufferedOutputStream(editor.newOutputStream(0), bufferSize);
  boolean copied = false;
  try {
    copied = IoUtils.copyStream(imageStream, os, listener, bufferSize);
  } finally {
    IoUtils.closeSilently(os);
    if (copied) {
      editor.commit();
    } else {
      editor.abort();
    }
  }
  return copied;
}
origin: wanliyang1990/WliveTV

@Override
public boolean remove(String imageUri) {
  try {
    return cache.remove(getKey(imageUri));
  } catch (IOException e) {
    L.e(e);
    return false;
  }
}
origin: com.nostra13.universalimageloader/universal-image-loader

@Override
public boolean remove(String imageUri) {
  try {
    return cache.remove(getKey(imageUri));
  } catch (IOException e) {
    L.e(e);
    return false;
  }
}
origin: jiangqqlmj/Android-Universal-Image-Loader-Modify

/**
 * 根据图片URL地址从缓存中删除文件
 * @param imageUri Image URI
 * @return
 */
@Override
public boolean remove(String imageUri) {
  try {
    return cache.remove(getKey(imageUri));
  } catch (IOException e) {
    L.e(e);
    return false;
  }
}
origin: com.nostra13.universalimageloader/universal-image-loader

@Override
public boolean save(String imageUri, Bitmap bitmap) throws IOException {
  DiskLruCache.Editor editor = cache.edit(getKey(imageUri));
  if (editor == null) {
    return false;
  }
  OutputStream os = new BufferedOutputStream(editor.newOutputStream(0), bufferSize);
  boolean savedSuccessfully = false;
  try {
    savedSuccessfully = bitmap.compress(compressFormat, compressQuality, os);
  } finally {
    IoUtils.closeSilently(os);
  }
  if (savedSuccessfully) {
    editor.commit();
  } else {
    editor.abort();
  }
  return savedSuccessfully;
}
origin: wanliyang1990/WliveTV

@Override
public boolean save(String imageUri, Bitmap bitmap) throws IOException {
  DiskLruCache.Editor editor = cache.edit(getKey(imageUri));
  if (editor == null) {
    return false;
  }
  OutputStream os = new BufferedOutputStream(editor.newOutputStream(0), bufferSize);
  boolean savedSuccessfully = false;
  try {
    savedSuccessfully = bitmap.compress(compressFormat, compressQuality, os);
  } finally {
    IoUtils.closeSilently(os);
  }
  if (savedSuccessfully) {
    editor.commit();
  } else {
    editor.abort();
  }
  return savedSuccessfully;
}
origin: wanliyang1990/WliveTV

@Override
public File get(String imageUri) {
  DiskLruCache.Snapshot snapshot = null;
  try {
    snapshot = cache.get(getKey(imageUri));
    return snapshot == null ? null : snapshot.getFile(0);
  } catch (IOException e) {
    L.e(e);
    return null;
  } finally {
    if (snapshot != null) {
      snapshot.close();
    }
  }
}
origin: com.nostra13.universalimageloader/universal-image-loader

@Override
public File get(String imageUri) {
  DiskLruCache.Snapshot snapshot = null;
  try {
    snapshot = cache.get(getKey(imageUri));
    return snapshot == null ? null : snapshot.getFile(0);
  } catch (IOException e) {
    L.e(e);
    return null;
  } finally {
    if (snapshot != null) {
      snapshot.close();
    }
  }
}
origin: jiangqqlmj/Android-Universal-Image-Loader-Modify

/**
 * 把图片bitmap存入到缓存器中
 * @param imageUri Original image URI  图片URL地址
 * @param bitmap   Image bitmap   需要保存的图片
 * @return
 * @throws IOException
 */
@Override
public boolean save(String imageUri, Bitmap bitmap) throws IOException {
  DiskLruCache.Editor editor = cache.edit(getKey(imageUri));
  if (editor == null) {
    return false;
  }
  //流写入文件
  OutputStream os = new BufferedOutputStream(editor.newOutputStream(0), bufferSize);
  boolean savedSuccessfully = false;
  try {
    savedSuccessfully = bitmap.compress(compressFormat, compressQuality, os);
  } finally {
    IoUtils.closeSilently(os);
  }
  if (savedSuccessfully) {
    editor.commit();
  } else {
    editor.abort();
  }
  return savedSuccessfully;
}
origin: jiangqqlmj/Android-Universal-Image-Loader-Modify

/**
 * 根据的URL连接 从LRU文件器重获取文件
 * @param imageUri Original image URI
 * @return
 */
@Override
public File get(String imageUri) {
  DiskLruCache.Snapshot snapshot = null;
  try {
    snapshot = cache.get(getKey(imageUri));
    return snapshot == null ? null : snapshot.getFile(0);
  } catch (IOException e) {
    L.e(e);
    return null;
  } finally {
    if (snapshot != null) {
      snapshot.close();
    }
  }
}
origin: com.nostra13.universalimageloader/universal-image-loader

@Override
public boolean save(String imageUri, InputStream imageStream, IoUtils.CopyListener listener) throws IOException {
  DiskLruCache.Editor editor = cache.edit(getKey(imageUri));
  if (editor == null) {
    return false;
  }
  OutputStream os = new BufferedOutputStream(editor.newOutputStream(0), bufferSize);
  boolean copied = false;
  try {
    copied = IoUtils.copyStream(imageStream, os, listener, bufferSize);
  } finally {
    IoUtils.closeSilently(os);
    if (copied) {
      editor.commit();
    } else {
      editor.abort();
    }
  }
  return copied;
}
origin: wanliyang1990/WliveTV

@Override
public boolean save(String imageUri, InputStream imageStream, IoUtils.CopyListener listener) throws IOException {
  DiskLruCache.Editor editor = cache.edit(getKey(imageUri));
  if (editor == null) {
    return false;
  }
  OutputStream os = new BufferedOutputStream(editor.newOutputStream(0), bufferSize);
  boolean copied = false;
  try {
    copied = IoUtils.copyStream(imageStream, os, listener, bufferSize);
  } finally {
    IoUtils.closeSilently(os);
    if (copied) {
      editor.commit();
    } else {
      editor.abort();
    }
  }
  return copied;
}
origin: jiangqqlmj/Android-Universal-Image-Loader-Modify

DiskLruCache.Editor editor = cache.edit(getKey(imageUri));
if (editor == null) {
  return false;
com.nostra13.universalimageloader.cache.disc.impl.extLruDiskCachegetKey

Javadoc

根据图片URL地址进行生成缓存文件名

Popular methods of LruDiskCache

  • <init>
  • initCache

Popular in Java

  • Running tasks concurrently on multiple threads
  • requestLocationUpdates (LocationManager)
  • addToBackStack (FragmentTransaction)
  • onCreateOptionsMenu (Activity)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now