Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@alexjlockwood
Created June 7, 2012 22:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexjlockwood/2891954 to your computer and use it in GitHub Desktop.
Save alexjlockwood/2891954 to your computer and use it in GitHub Desktop.
public abstract class AlbumStorageDirFactory {
/**
* Returns a File object that points to the folder that will store
* the album's pictures.
*/
public abstract File getAlbumStorageDir(String albumName);
/**
* A static factory method that returns a new AlbumStorageDirFactory
* instance based on the current device's SDK version.
*/
public static AlbumStorageDirFactory newInstance() {
if (CompatabilityUtil.isFroyo()) {
return new FroyoAlbumDirFactory();
} else {
return new BaseAlbumDirFactory();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment