Code:
package com.rs.cache.loaders;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.HashMap;
import java.util.LinkedList;
import com.alex.utils.Constants;
import com.rs.cache.Cache;
import com.rs.game.player.Equipment;
import com.rs.game.player.Skills;
import com.rs.io.InputStream;
import com.rs.utils.Utils;
@SuppressWarnings("unused")
public final class ItemDefinitions {
private static final ItemDefinitions[] itemsDefinitions;
static { // that's why this is here
itemsDefinitions = new ItemDefinitions[Utils.getItemDefinitionsSize()];
}
private int id;
private boolean loaded;
public int modelId;
private String name;
// model size information
private int modelZoom;
private int modelRotation1;
private int modelRotation2;
private int modelOffset1;
private int modelOffset2;
// extra information
private int stackable;
private int value;
private boolean membersOnly;
// wearing model information
private int maleEquip1;
private int femaleEquip1;
private int maleEquip2;
private int femaleEquip2;
// options
private String[] groundOptions;
public String[] inventoryOptions;
// model information
public int[] originalModelColors;
public int[] modifiedModelColors;
public short[] originalTextureColors;
private short[] modifiedTextureColors;
private byte[] unknownArray1;
private int[] unknownArray2;
// extra information, not used for newer items
private boolean unnoted;
private int maleEquipModelId3;
private int femaleEquipModelId3;
private int unknownInt1;
private int unknownInt2;
private int unknownInt3;
private int unknownInt4;
private int unknownInt5;
private int unknownInt6;
private int certId;
private int certTemplateId;
private int[] stackIds;
private int[] stackAmounts;
private int unknownInt7;
private int unknownInt8;
private int unknownInt9;
private int unknownInt10;
private int unknownInt11;
public int teamId;
private int lendId;
private int lendTemplateId;
private int unknownInt12;
private int unknownInt13;
private int unknownInt14;
private int unknownInt15;
private int unknownInt16;
private int unknownInt17;
private int unknownInt18;
private int unknownInt19;
private int unknownInt20;
private int unknownInt21;
private int unknownInt22;
private int unknownInt23;
private int equipSlot;
private int equipType;
// extra added
private boolean noted;
private boolean lended;
private HashMap<Integer, Object> clientScriptData;
private HashMap<Integer, Integer> itemRequiriments;
public static final ItemDefinitions getItemDefinitions(int itemId) {
if (itemId < 0 || itemId >= itemsDefinitions.length)
itemId = 0;
ItemDefinitions def = itemsDefinitions[itemId];
if (def == null)
itemsDefinitions[itemId] = def = new ItemDefinitions(itemId);
return def;
}
public static final void clearItemsDefinitions() {
for (int i = 0; i < itemsDefinitions.length; i++)
itemsDefinitions[i] = null;
}
public ItemDefinitions(int id) {
this.id = id;
setDefaultsVariableValues();
setDefaultOptions();
loadItemDefinitions();
}
public boolean isLoaded() {
return loaded;
}
private final void loadItemDefinitions() {
byte[] data = Cache.STORE.getIndexes()[Constants.ITEM_DEFINITIONS_INDEX].getFile(getArchiveId(), getFileId());
if (data == null) {
// System.out.println("Failed loading Item " + id+".");
return;
}
readOpcodeValues(new InputStream(data));
if (certTemplateId != -1)
toNote();
if (lendTemplateId != -1)
toLend();
if (unknownValue1 != -1)
toBind();
loaded = true;
}
private void toNote() {
// ItemDefinitions noteItem; //certTemplateId
ItemDefinitions realItem = getItemDefinitions(certId);
membersOnly = realItem.membersOnly;
value = realItem.value;
name = realItem.name;
stackable = 1;
noted = true;
}
private void toBind() {
// ItemDefinitions lendItem; //lendTemplateId
ItemDefinitions realItem = getItemDefinitions(unknownValue2);
originalModelColors = realItem.originalModelColors;
maleEquipModelId3 = realItem.maleEquipModelId3;
femaleEquipModelId3 = realItem.femaleEquipModelId3;
teamId = realItem.teamId;
value = 0;
membersOnly = realItem.membersOnly;
name = realItem.name;
inventoryOptions = new String[5];
groundOptions = realItem.groundOptions;
if (realItem.inventoryOptions != null)
for (int optionIndex = 0; optionIndex < 4; optionIndex++)
inventoryOptions[optionIndex] = realItem.inventoryOptions[optionIndex];
inventoryOptions[4] = "Discard";
maleEquip1 = realItem.maleEquip1;
maleEquip2 = realItem.maleEquip2;
femaleEquip1 = realItem.femaleEquip1;
femaleEquip2 = realItem.femaleEquip2;
clientScriptData = realItem.clientScriptData;
equipSlot = realItem.equipSlot;
equipType = realItem.equipType;
}
private void toLend() {
// ItemDefinitions lendItem; //lendTemplateId
ItemDefinitions realItem = getItemDefinitions(lendId);
originalModelColors = realItem.originalModelColors;
maleEquipModelId3 = realItem.maleEquipModelId3;
femaleEquipModelId3 = realItem.femaleEquipModelId3;
teamId = realItem.teamId;
value = 0;
membersOnly = realItem.membersOnly;
name = realItem.name;
inventoryOptions = new String[5];
groundOptions = realItem.groundOptions;
if (realItem.inventoryOptions != null)
for (int optionIndex = 0; optionIndex < 4; optionIndex++)
inventoryOptions[optionIndex] = realItem.inventoryOptions[optionIndex];
inventoryOptions[4] = "Discard";
maleEquip1 = realItem.maleEquip1;
maleEquip2 = realItem.maleEquip2;
femaleEquip1 = realItem.femaleEquip1;
femaleEquip2 = realItem.femaleEquip2;
clientScriptData = realItem.clientScriptData;
equipSlot = realItem.equipSlot;
equipType = realItem.equipType;
lended = true;
}
public int getArchiveId() {
return getId() >>> 8;
}
public int getFileId() {
return 0xff & getId();
}
public boolean isDestroyItem() {
if (inventoryOptions == null)
return false;
for (String option : inventoryOptions) {
if (option == null)
continue;
if (option.equalsIgnoreCase("destroy"))
return true;
}
return false;
}
public boolean containsOption(int i, String option) {
if (inventoryOptions == null || inventoryOptions[i] == null || inventoryOptions.length <= i)
return false;
return inventoryOptions[i].equals(option);
}
public boolean containsOption(String option) {
if (inventoryOptions == null)
return false;
for (String o : inventoryOptions) {
if (o == null || !o.equals(option))
continue;
return true;
}
return false;
}
public boolean isWearItem() {
return equipSlot != -1;
}
public boolean isWearItem(boolean male) {
if (equipSlot < Equipment.SLOT_RING && (male ? getMaleWornModelId1() == -1
: getFemaleWornModelId1() == -1))
return false;
return equipSlot != -1;
}
public boolean hasSpecialBar() {
if (clientScriptData == null)
return false;
Object specialBar = clientScriptData.get(686);
if (specialBar != null && specialBar instanceof Integer)
return (Integer) specialBar == 1;
return false;
}
public int getRenderAnimId() {
if (clientScriptData == null)
return 1426;
Object animId = clientScriptData.get(644);
if (animId != null && animId instanceof Integer)
return (Integer) animId;
return 1426;
}
public int getModelZoom() {
return modelZoom;
}
public int getModelOffset1() {
return modelOffset1;
}
public int getModelOffset2() {
return modelOffset2;
}
public int getQuestId() {
if (clientScriptData == null)
return -1;
Object questId = clientScriptData.get(861);
if (questId != null && questId instanceof Integer)
return (Integer) questId;
return -1;
}
public HashMap<Integer, Integer> getCreateItemRequirements() {
if (clientScriptData == null)
return null;
HashMap<Integer, Integer> items = new HashMap<Integer, Integer>();
int requiredId = -1;
int requiredAmount = -1;
for (int key : clientScriptData.keySet()) {
Object value = clientScriptData.get(key);
if (value instanceof String)
continue;
if (key >= 538 && key <= 770) {
if (key % 2 == 0)
requiredId = (Integer) value;
else
requiredAmount = (Integer) value;
if (requiredId != -1 && requiredAmount != -1) {
items.put(requiredAmount, requiredId);
requiredId = -1;
requiredAmount = -1;
}
}
}
return items;
}
public HashMap<Integer, Object> getClientScriptData() {
return clientScriptData;
}
public HashMap<Integer, Integer> getWearingSkillRequiriments() {
if (clientScriptData == null)
return null;
if (itemRequiriments == null) {
HashMap<Integer, Integer> skills = new HashMap<Integer, Integer>();
for (int i = 0; i < 10; i++) {
Integer skill = (Integer) clientScriptData.get(749 + (i * 2));
if (skill != null) {
Integer level = (Integer) clientScriptData
.get(750 + (i * 2));
if (level != null)
skills.put(skill, level);
}
}
Integer maxedSkill = (Integer) clientScriptData.get(277);
if (maxedSkill != null)
skills.put(maxedSkill, getId() == 19709 ? 120 : 99);
itemRequiriments = skills;
if (getId() == 7462)
itemRequiriments.put(Skills.DEFENCE, 40);
else if (name.equals("Dragon defender")) {
itemRequiriments.put(Skills.ATTACK, 60);
itemRequiriments.put(Skills.DEFENCE, 60);
}
}
return itemRequiriments;
}
/*
* public HashMap<Integer, Integer> getWearingSkillRequiriments() { if
* (clientScriptData == null) return null; HashMap<Integer, Integer> skills
* = new HashMap<Integer, Integer>(); int nextLevel = -1; int nextSkill =
* -1; for (int key : clientScriptData.keySet()) { Object value =
* clientScriptData.get(key); if (value instanceof String) continue; if(key
* == 277) { skills.put((Integer) value, id == 19709 ? 120 : 99); }else if
* (key == 23 && id == 15241) { skills.put(4, (Integer) value);
* skills.put(11, 61); } else if (key >= 749 && key < 797) { if (key % 2 ==
* 0) nextLevel = (Integer) value; else nextSkill = (Integer) value; if
* (nextLevel != -1 && nextSkill != -1) { skills.put(nextSkill, nextLevel);
* nextLevel = -1; nextSkill = -1; } }
*
* } return skills; }
*/
private void setDefaultOptions() {
groundOptions = new String[] { null, null, "take", null, null };
inventoryOptions = new String[] { null, null, null, null, "drop" };
}
private void setDefaultsVariableValues() {
name = "null";
maleEquip1 = -1;
maleEquip2 = -1;
femaleEquip1 = -1;
femaleEquip2 = -1;
modelZoom = 2000;
lendId = -1;
lendTemplateId = -1;
certId = -1;
certTemplateId = -1;
unknownInt9 = 128;
value = 1;
maleEquipModelId3 = -1;
femaleEquipModelId3 = -1;
unknownValue1 = -1;
unknownValue2 = -1;
teamId = -1;
equipSlot = -1;
equipType = -1;
}
private final void readValues(InputStream stream, int opcode) {
if (1 == opcode)
((ItemDefinitions) this).anInt5738 = (oldItems ? stream.readCustomUnsignedShort() : stream.readBigSmart(1235052657)) * -1019082089;// model
// id
else if (2 == opcode)
aString5707 = stream.readString(1338906243);// name
else if (opcode == 4)
anInt5713 = stream.readUnsignedShort() * -1885125181;
else if (5 == opcode)
anInt5714 = stream.readUnsignedShort() * -2068311459;
else if (6 == opcode)
anInt5715 = stream.readUnsignedShort() * -629359451;
else if (7 == opcode) {
anInt5717 = stream.readUnsignedShort() * -1497539247;
if (anInt5717 * 252709809 > 32767)
anInt5717 -= 1565589504;
} else if (opcode == 8) {
anInt5718 = stream.readUnsignedShort() * -572964665;
if (-1811316489 * anInt5718 > 32767)
anInt5718 -= 1086783488;
} else if (opcode == 11)
anInt5704 = 126481113;
else if (12 == opcode)
anInt5721 = stream.readInt((byte) -4) * -1375390745;
else if (opcode == 13)
anInt5733 = stream.readUnsignedByte() * -2026784241;
else if (14 == opcode)
anInt5772 = stream.readUnsignedByte() * -583083477;
else if (16 == opcode)
aBoolean5731 = true;
else if (18 == opcode)
anInt5720 = stream.readUnsignedShort() * -1741576309;
else if (opcode == 23)
anInt5724 = (oldItems ? stream.readCustomUnsignedShort() : stream.readBigSmart(1235052657)) * -1612514031;
else if (opcode == 24)
((ItemDefinitions) this).anInt5737 = (oldItems ? stream.readCustomUnsignedShort() : stream.readBigSmart(1235052657)) * 582597415;
else if (25 == opcode)
anInt5747 = (oldItems ? stream.readCustomUnsignedShort() : stream.readBigSmart(1235052657)) * -1430077763;
else if (26 == opcode)
((ItemDefinitions) this).anInt5746 = (oldItems ? stream.readCustomUnsignedShort() : stream.readBigSmart(1235052657)) * -336299543;
else if (opcode == 27)
anInt5735 = stream.readUnsignedByte() * -1438605935;
else if (opcode >= 30 && opcode < 35)
aStringArray5723[opcode - 30] = stream.readString(2111111360);
else if (opcode >= 35 && opcode < 40)
aStringArray5732[opcode - 35] = stream.readString(-101192414);
else if (40 == opcode) {
int i_65_ = stream.readUnsignedByte();
((ItemDefinitions) this).aShortArray5754 = new short[i_65_];
((ItemDefinitions) this).aShortArray5706 = new short[i_65_];
for (int i_66_ = 0; i_66_ < i_65_; i_66_++) {
((ItemDefinitions) this).aShortArray5754[i_66_] = (short) stream.readUnsignedShort();
((ItemDefinitions) this).aShortArray5706[i_66_] = (short) stream.readUnsignedShort();
}
} else if (41 == opcode) {
int i_67_ = stream.readUnsignedByte();
((ItemDefinitions) this).aShortArray5711 = new short[i_67_];
((ItemDefinitions) this).aShortArray5712 = new short[i_67_];
for (int i_68_ = 0; i_68_ < i_67_; i_68_++) {
((ItemDefinitions) this).aShortArray5711[i_68_] = (short) stream.readUnsignedShort();
((ItemDefinitions) this).aShortArray5712[i_68_] = (short) stream.readUnsignedShort();
}
} else if (opcode == 42) {
int i_69_ = stream.readUnsignedByte();
((ItemDefinitions) this).aByteArray5708 = new byte[i_69_];
for (int i_70_ = 0; i_70_ < i_69_; i_70_++)
((ItemDefinitions) this).aByteArray5708[i_70_] = stream.readByte(-12558881);
} else if (43 == opcode) {
anInt5763 = stream.readInt((byte) 6) * 682064309;
aBoolean5771 = true;
} else if (44 == opcode) {
int i_92_ = (short) stream.readUnsignedShort();
int i_93_ = 0;
for (int i_94_ = i_92_; i_94_ > 0; i_94_ >>= 1)
i_93_++;
aByteArray5609 = new byte[i_93_];
byte i_95_ = 0;
for (int i_96_ = 0; i_96_ < i_93_; i_96_++) {
if ((i_92_ & 1 << i_96_) > 0) {
aByteArray5609[i_96_] = i_95_;
i_95_++;
} else
aByteArray5609[i_96_] = (byte) -1;
}
} else if (45 == opcode) {
int i_97_ = (short) stream.readUnsignedShort();
int i_98_ = 0;
for (int i_99_ = i_97_; i_99_ > 0; i_99_ >>= 1)
i_98_++;
aByteArray5904 = new byte[i_98_];
byte i_100_ = 0;
for (int i_101_ = 0; i_101_ < i_98_; i_101_++) {
if ((i_97_ & 1 << i_101_) > 0) {
aByteArray5904[i_101_] = i_100_;
i_100_++;
} else
aByteArray5904[i_101_] = (byte) -1;
}
} else if (65 == opcode)
aBoolean5734 = true;
else if (78 == opcode)
((ItemDefinitions) this).anInt5759 = (oldItems ? stream.readCustomUnsignedShort() : stream.readBigSmart(1235052657)) * 756401161;
else if (opcode == 79)
((ItemDefinitions) this).anInt5741 = (oldItems ? stream.readCustomUnsignedShort() : stream.readBigSmart(1235052657)) * 2098680761;
else if (opcode == 90)
((ItemDefinitions) this).anInt5760 = (oldItems ? stream.readCustomUnsignedShort() : stream.readBigSmart(1235052657)) * 1319962769;
else if (opcode == 91)
((ItemDefinitions) this).anInt5750 = (oldItems ? stream.readCustomUnsignedShort() : stream.readBigSmart(1235052657)) * 1598907469;
else if (opcode == 92)
((ItemDefinitions) this).anInt5749 = (oldItems ? stream.readCustomUnsignedShort() : stream.readBigSmart(1235052657)) * -1935344449;
else if (93 == opcode)
((ItemDefinitions) this).anInt5764 = (oldItems ? stream.readCustomUnsignedShort() : stream.readBigSmart(1235052657)) * -1194369871;
else if (95 == opcode)
anInt5716 = stream.readUnsignedShort() * -883520799;
else if (96 == opcode)
anInt5765 = stream.readUnsignedByte() * 135187667;
else if (opcode == 97)
anInt5709 = stream.readUnsignedShort() * -384973719;
else if (98 == opcode)
anInt5755 = stream.readUnsignedShort() * 1831957949;
else if (opcode >= 100 && opcode < 110) {
if (((ItemDefinitions) this).anIntArray5752 == null) {
((ItemDefinitions) this).anIntArray5752 = new int[10];
((ItemDefinitions) this).anIntArray5753 = new int[10];
}
((ItemDefinitions) this).anIntArray5752[opcode - 100] = stream.readUnsignedShort();
((ItemDefinitions) this).anIntArray5753[opcode - 100] = stream.readUnsignedShort();
} else if (opcode == 110)
((ItemDefinitions) this).anInt5758 = stream.readUnsignedShort() * -237762771;
else if (111 == opcode)
((ItemDefinitions) this).anInt5702 = stream.readUnsignedShort() * 355882061;
else if (opcode == 112)
((ItemDefinitions) this).anInt5739 = stream.readUnsignedShort() * 1219480869;
else if (opcode == 113)
((ItemDefinitions) this).anInt5761 = stream.readByte(-12558881) * 712208909;
else if (opcode == 114)
((ItemDefinitions) this).anInt5762 = stream.readByte(-12558881) * -1050247335;
else if (115 == opcode)
anInt5700 = stream.readUnsignedByte() * 1325490629;
else if (121 == opcode)
((ItemDefinitions) this).anInt5756 = stream.readUnsignedShort() * -970653687;
else if (122 == opcode)
anInt5719 = stream.readUnsignedShort() * 2015131539;
else if (opcode == 125) {
((ItemDefinitions) this).anInt5742 = ((stream.readByte(-12558881) << 2) * -1833538443);
((ItemDefinitions) this).anInt5744 = (stream.readByte(-12558881) << 2) * -25983505;
((ItemDefinitions) this).anInt5748 = (stream.readByte(-12558881) << 2) * 1243416501;
} else if (opcode == 126) {
((ItemDefinitions) this).anInt5743 = ((stream.readByte(-12558881) << 2) * -1039520547);
((ItemDefinitions) this).anInt5745 = (stream.readByte(-12558881) << 2) * 1803423949;
((ItemDefinitions) this).anInt5710 = (stream.readByte(-12558881) << 2) * 519268429;
} else if (opcode == 127) {
anInt5729 = stream.readUnsignedByte() * 947829311;
anInt5725 = stream.readUnsignedShort() * 300082645;
} else if (128 == opcode) {
anInt5730 = stream.readUnsignedByte() * -1036837039;
anInt5703 = stream.readUnsignedShort() * 1829509431;
} else if (129 == opcode) {
anInt5736 = stream.readUnsignedByte() * -2098727417;
anInt5727 = stream.readUnsignedShort() * -48114927;
} else if (opcode == 130) {
anInt5722 = stream.readUnsignedByte() * -969618575;
anInt5728 = stream.readUnsignedShort() * -1531140281;
} else if (132 == opcode) {
int i_71_ = stream.readUnsignedByte();
anIntArray5767 = new int[i_71_];
for (int i_72_ = 0; i_72_ < i_71_; i_72_++)
anIntArray5767[i_72_] = stream.readUnsignedShort();
} else if (134 == opcode)
anInt5768 = stream.readUnsignedByte() * 1394978643;
else if (139 == opcode)
((ItemDefinitions) this).anInt5769 = stream.readUnsignedShort() * 257950023;
else if (opcode == 140)
anInt5770 = stream.readUnsignedShort() * 78716625;
else if (opcode >= 142 && opcode < 147) {
if (aByteIntArray5869 == null) {
aByteIntArray5869 = new int[6];
Arrays.fill(aByteIntArray5869, -1);
}
aByteIntArray5869[opcode - 142] = (short) stream.readUnsignedShort();
} else if (opcode >= 150 && opcode < 155) {
if (null == anIntArray5960) {
anIntArray5960 = new int[5];
Arrays.fill(anIntArray5960, -1);
}
anIntArray5960[opcode - 150] = (short) stream.readUnsignedShort();
} else if (249 == opcode) {
int i_73_ = stream.readUnsignedByte();
if (null == ((ItemDefinitions) this).aClass437_5766) {
int i_74_ = Class416.method5590(i_73_, (byte) 16);
((ItemDefinitions) this).aClass437_5766 = new LinkedList(i_74_);
}
for (int i_75_ = 0; i_75_ < i_73_; i_75_++) {// client script
// map
boolean bool = stream.readUnsignedByte() == 1;
int i_76_ = stream.read24BitUnsignedInteger((byte) 15);
Class298 class298;
if (bool)
class298 = new Class298_Sub29(stream.readString(-1208778402));
else
class298 = new Class298_Sub35(stream.readInt((byte) 69));
((ItemDefinitions) this).aClass437_5766.method5817(class298, (long) i_76_);
}
} else
throw new RuntimeException("MISSING OPCODE " + opcode
+ " FOR ITEM " + getId());
}
private int unknownValue1;
private int unknownValue2;
private final void readOpcodeValues(InputStream stream) {
while (true) {
int opcode = stream.readUnsignedByte();
if (opcode == 0)
break;
readValues(stream, opcode);
}
}
public String getName() {
return name;
}
public String getLowerCaseName() {
name = name.toLowerCase();
return name;
}
public int getFemaleWornModelId1() {
return femaleEquip1;
}
public int getFemaleWornModelId2() {
return femaleEquip2;
}
public int getMaleWornModelId1() {
return maleEquip1;
}
public int getMaleWornModelId2() {
return maleEquip2;
}
public boolean isOverSized() {
return modelZoom > 5000;
}
public boolean isLended() {
return lended;
}
public boolean isMembersOnly() {
return membersOnly;
}
public boolean isStackable() {
return stackable == 1;
}
public boolean isNoted() {
return noted;
}
public int getLendId() {
return lendId;
}
public int getCertId() {
return certId;
}
public int getValue() {
return value;
}
public int getId() {
return id;
}
public int getEquipSlot() {
return equipSlot;
}
public int getEquipType() {
return equipType;
}
public int getGEPrice() {
try {
for (String lines : FileUtilities.readFile("./data/items/grand_exchange/tipit_dump.txt")) {
String[] data = lines.split(" - ");
if (Integer.parseInt(data[0]) == id) return Integer.parseInt(data[1]);
}
} catch (NumberFormatException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return -1;
}
// hehe lil cheap shit :p
public static class FileUtilities {
public static final int BUFFER = 1024;
public static boolean exists(String name) {
File file = new File(name);
return file.exists();
}
public static ByteBuffer fileBuffer(String name) throws IOException {
File file = new File(name);
if(!file.exists())
return null;
FileInputStream in = new FileInputStream(name);
byte[] data = new byte[BUFFER];
int read;
try {
ByteBuffer buffer = ByteBuffer.allocate(in.available() + 1);
while ((read = in.read(data, 0, BUFFER)) != -1) {
buffer.put(data, 0, read);
}
buffer.flip();
return buffer;
} finally {
if (in != null)
in.close();
in = null;
}
}
public static void writeBufferToFile(String name, ByteBuffer buffer) throws IOException {
File file = new File(name);
if(!file.exists())
file.createNewFile();
FileOutputStream out = new FileOutputStream(name);
out.write(buffer.array(), 0, buffer.remaining());
out.flush();
out.close();
}
public static LinkedList<String> readFile(String directory) throws IOException {
LinkedList<String> fileLines = new LinkedList<String>();
BufferedReader reader = null;
try {
reader = new BufferedReader(new FileReader(directory));
String string;
while ((string = reader.readLine()) != null) {
fileLines.add(string);
}
} finally {
if (reader != null) {
reader.close();
reader = null;
}
}
return fileLines;
}
}
public static ItemDefinitions forName(String substring) {
// TODO Auto-generated method stub
return null;
}
}