Skip to content

Commit

Permalink
Allows username not be present when reading a Gallery from properties.
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Luc Paour committed Jun 26, 2003
1 parent 5b86937 commit 0f10f53
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions com/gallery/GalleryRemote/model/Gallery.java
Expand Up @@ -30,6 +30,7 @@
import com.gallery.GalleryRemote.*;
import com.gallery.GalleryRemote.prefs.PropertiesFile;
import com.gallery.GalleryRemote.prefs.PreferenceNames;
import com.gallery.GalleryRemote.prefs.GalleryProperties;

/**
* Gallery model
Expand Down Expand Up @@ -417,12 +418,15 @@ public int getType() {
return type;
}

public static Gallery readFromProperties(GalleryProperties p, int prefsIndex, StatusUpdate su) {
return readFromProperties(p, prefsIndex, su, true);
}

public static Gallery readFromProperties(PropertiesFile p, int prefsIndex, StatusUpdate su) {
public static Gallery readFromProperties(GalleryProperties p, int prefsIndex, StatusUpdate su, boolean mustHaveUsername) {
String url = p.getProperty( URL + prefsIndex );
String username = p.getProperty( USERNAME + prefsIndex );

if (username == null) {
if (mustHaveUsername && username == null) {
return null;
}

Expand Down

0 comments on commit 0f10f53

Please sign in to comment.