BrightSide Workbench Full Report + Source Code
org.turro.elephant.impl.util.Serializer Class Reference

Static Public Member Functions

static File getFile (String fileName)
 
static File[] getFiles (String rootName)
 
static File[] getFiles (File root)
 
static void serialize (String fileName, Object instance)
 
static void serialize (File file, Object instance)
 
static Object deserialize (String fileName)
 
static Object deserialize (File file)
 
static void remove (String fileName)
 
static void remove (File file)
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 28 of file Serializer.java.

Member Function Documentation

◆ deserialize() [1/2]

static Object org.turro.elephant.impl.util.Serializer.deserialize ( File  file)
static

Definition at line 65 of file Serializer.java.

65  {
66  return org.turro.reflection.Serializer.deserialize(file);
67  }

◆ deserialize() [2/2]

static Object org.turro.elephant.impl.util.Serializer.deserialize ( String  fileName)
static

Definition at line 60 of file Serializer.java.

60  {
61  File file = new File(ElephantContext.getRealPath("/WEB-INF/serializer" + fileName));
62  return deserialize(file);
63  }
static Object deserialize(String fileName)
Definition: Serializer.java:60
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFile()

static File org.turro.elephant.impl.util.Serializer.getFile ( String  fileName)
static

Definition at line 30 of file Serializer.java.

30  {
31  return new File(ElephantContext.getRealPath("/WEB-INF/serializer" + fileName));
32  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFiles() [1/2]

static File [] org.turro.elephant.impl.util.Serializer.getFiles ( File  root)
static

Definition at line 40 of file Serializer.java.

40  {
41  return root.listFiles(new FileFilter() {
42  @Override
43  public boolean accept(File pathname) {
44  return pathname.isFile() || !pathname.isHidden();
45  }
46  });
47  }

◆ getFiles() [2/2]

static File [] org.turro.elephant.impl.util.Serializer.getFiles ( String  rootName)
static

Definition at line 34 of file Serializer.java.

34  {
35  File root = new File(ElephantContext.getRealPath("/WEB-INF/serializer" + rootName));
36  if(!root.exists()) root.mkdirs();
37  return getFiles(root);
38  }
static File[] getFiles(String rootName)
Definition: Serializer.java:34
Here is the call graph for this function:
Here is the caller graph for this function:

◆ remove() [1/2]

static void org.turro.elephant.impl.util.Serializer.remove ( File  file)
static

Definition at line 74 of file Serializer.java.

74  {
75  file.delete();
76  }

◆ remove() [2/2]

static void org.turro.elephant.impl.util.Serializer.remove ( String  fileName)
static

Definition at line 69 of file Serializer.java.

69  {
70  File file = new File(ElephantContext.getRealPath("/WEB-INF/serializer" + fileName));
71  remove(file);
72  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ serialize() [1/2]

static void org.turro.elephant.impl.util.Serializer.serialize ( File  file,
Object  instance 
)
static

Definition at line 54 of file Serializer.java.

54  {
55  File root = new File(org.amic.util.file.FileUtil.getParentPath(file));
56  if(!root.exists()) root.mkdirs();
57  org.turro.reflection.Serializer.serialize(file, instance);
58  }

◆ serialize() [2/2]

static void org.turro.elephant.impl.util.Serializer.serialize ( String  fileName,
Object  instance 
)
static

Definition at line 49 of file Serializer.java.

49  {
50  File file = new File(ElephantContext.getRealPath("/WEB-INF/serializer" + fileName));
51  serialize(file, instance);
52  }
static void serialize(String fileName, Object instance)
Definition: Serializer.java:49
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: