private static LinkedList createResources(BufferedReader buf,
        LinkedList routerList, LinkedList files) throws Exception {
        String line;
        String routerName;
        String resourceName;
        String regionalRC;
        double storage_size;
        double bandwidth;

        DataGridResource r1;
        DataGridResource r2;
        Router tempRouter;
        Link tempLink;
        LinkedList resourceList = new LinkedList();
        StringTokenizer str;

        while ((line = buf.readLine()) != null) {
            str = new StringTokenizer(line);
            resourceName = str.nextToken();

            if (!(resourceName.startsWith("#"))) {
                storage_size = Double.parseDouble(str.nextToken());
                bandwidth = Double.parseDouble(str.nextToken());
                routerName = str.nextToken(); // read the router name

                if (ParameterReader.useLocalRC) {
                    regionalRC = null;
                } else {
                    regionalRC = str.nextToken();
                }

                r1 = createStandardResource(resourceName, storage_size,
                        bandwidth, regionalRC);

                // attach the resource to a router
                tempRouter = NetworkReader.getRouter(routerName, routerList);

                if (tempRouter != null) {
                     tempRouter.attachHost(r1, new FIFOScheduler(r1.get_name()
                     + "_scheduler"));

                } else {
                    System.out.println(
                        "ERROR - Resource reader- non existing router");
                }

                // read and add the files to the resource
                while (str.hasMoreTokens()) {
                    String filename = str.nextToken();
                    System.out.println("Adding file " + filename);

                    File tempFile = findFile(filename, files);
                    r1.addFile(tempFile);
                }

                // add resource to the list
                resourceList.add(r1);
            }
        }

        return resourceList;
    }