Fix style

This commit is contained in:
Anthony Corbacho 2016-10-24 11:47:45 +09:00
parent 517ebc88f5
commit d49bfe1387
3 changed files with 60 additions and 63 deletions

View file

@ -20,25 +20,25 @@ import java.util.List;
import java.util.Map;
/**
* Notebook repo settings.
* This represent a structure of a notebook repo settings that will mostly used in the frontend.
* Notebook repo settings. This represent a structure of a notebook repo settings that will mostly
* used in the frontend.
*
*/
public class NotebookRepoSettings {
/**
* Type of value, It can be text or list.
*/
public enum Type {
INPUT, DROPDOWN
}
/**
* Type of value, It can be text or list.
*/
public enum Type {
INPUT, DROPDOWN
}
public static NotebookRepoSettings newInstance() {
return new NotebookRepoSettings();
}
public static NotebookRepoSettings newInstance() {
return new NotebookRepoSettings();
}
public Type type;
public List<Map<String, String>> value;
public String selected;
public String name;
public Type type;
public List<Map<String, String>> value;
public String selected;
public String name;
}

View file

@ -22,59 +22,58 @@ import java.util.List;
import org.apache.commons.lang.StringUtils;
/**
* Representation of a notebook repo with settings.
* This is mostly a Wrapper around notebook repo information plus settings.
* Representation of a notebook repo with settings. This is mostly a Wrapper around notebook repo
* information plus settings.
*/
public class NotebookRepoWithSettings {
public static final NotebookRepoWithSettings EMPTY = NotebookRepoWithSettings
.builder(StringUtils.EMPTY)
.build();
public static final NotebookRepoWithSettings EMPTY =
NotebookRepoWithSettings.builder(StringUtils.EMPTY).build();
public String name;
public String className;
public List<NotebookRepoSettings> settings;
public String name;
public String className;
public List<NotebookRepoSettings> settings;
private NotebookRepoWithSettings() {}
private NotebookRepoWithSettings() {}
public static Builder builder(String name) {
return new Builder(name);
public static Builder builder(String name) {
return new Builder(name);
}
private NotebookRepoWithSettings(Builder builder) {
name = builder.name;
className = builder.className;
settings = builder.settings;
}
public boolean isEmpty() {
return this.equals(EMPTY);
}
/**
* Simple builder :).
*/
public static class Builder {
private final String name;
private String className = StringUtils.EMPTY;
private List<NotebookRepoSettings> settings = Collections.emptyList();
public Builder(String name) {
this.name = name;
}
private NotebookRepoWithSettings(Builder builder) {
name = builder.name;
className = builder.className;
settings = builder.settings;
public NotebookRepoWithSettings build() {
return new NotebookRepoWithSettings(this);
}
public boolean isEmpty() {
return this.equals(EMPTY);
public Builder className(String className) {
this.className = className;
return this;
}
/**
* Simple builder :).
*/
public static class Builder {
private final String name;
private String className = StringUtils.EMPTY;
private List<NotebookRepoSettings> settings = Collections.emptyList();
public Builder(String name) {
this.name = name;
}
public NotebookRepoWithSettings build() {
return new NotebookRepoWithSettings(this);
}
public Builder className(String className) {
this.className = className;
return this;
}
public Builder settings(List<NotebookRepoSettings> settings) {
this.settings = settings;
return this;
}
public Builder settings(List<NotebookRepoSettings> settings) {
this.settings = settings;
return this;
}
}
}

View file

@ -33,7 +33,6 @@ import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.vfs2.FileContent;
import org.apache.commons.vfs2.FileObject;
import org.apache.commons.vfs2.FileSystemException;
import org.apache.commons.vfs2.FileSystemManager;
import org.apache.commons.vfs2.FileType;
import org.apache.commons.vfs2.NameScope;
@ -44,15 +43,13 @@ import org.apache.zeppelin.conf.ZeppelinConfiguration.ConfVars;
import org.apache.zeppelin.notebook.ApplicationState;
import org.apache.zeppelin.notebook.Note;
import org.apache.zeppelin.notebook.NoteInfo;
import org.apache.zeppelin.notebook.Paragraph;
import org.apache.zeppelin.notebook.NotebookImportDeserializer;
import org.apache.zeppelin.notebook.Paragraph;
import org.apache.zeppelin.scheduler.Job.Status;
import org.apache.zeppelin.user.AuthenticationInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
@ -61,7 +58,7 @@ import com.google.gson.GsonBuilder;
*
*/
public class VFSNotebookRepo implements NotebookRepo {
private final static Logger LOG = LoggerFactory.getLogger(VFSNotebookRepo.class);
private static final Logger LOG = LoggerFactory.getLogger(VFSNotebookRepo.class);
private FileSystemManager fsManager;
private URI filesystemRoot;
@ -328,7 +325,8 @@ public class VFSNotebookRepo implements NotebookRepo {
LOG.error("Notebook path is invalid");
return;
}
LOG.warn("{} will change notebook dir from {} to {}", getNotebookDirPath(), newNotebookDirectotyPath);
LOG.warn("{} will change notebook dir from {} to {}",
getNotebookDirPath(), newNotebookDirectotyPath);
try {
setNotebookDirectory(newNotebookDirectotyPath);
} catch (IOException e) {