Package flex2.compiler.io

Examples of flex2.compiler.io.ResourceFile


     *
     * @param includeSource A source file.
     */
    public void removeComponent(File includeSource)
    {
        sources.remove(new LocalFile(includeSource));
    }
View Full Code Here


     * @param name The name in the archive.
     * @param file The file to be added.
     */
    public void addArchiveFile(String name, File file)
    {
        files.put(name, new LocalFile(file));
    }
View Full Code Here

     * @param file The file to be added.
     * @since 3.0
     */
    public void addStyleSheet(String name, File file)
    {
        stylesheets.put(name, new LocalFile(file));
    }
View Full Code Here

     */
    public Application(File file, LibraryCache libraryCache) throws FileNotFoundException
    {
        if (file.exists())
        {
            init(new VirtualFile[] { new LocalFile(FileUtil.getCanonicalFile(file)) });
        }
        else
        {
            throw new FileNotFoundException(FileUtil.getCanonicalPath(file));
        }
View Full Code Here

        if (file != null && file.exists())
        {
            try
            {
                result = new LocalFile(file.getCanonicalFile());
            }
            catch (IOException e)
            {
                // TODO Auto-generated catch block
                e.printStackTrace();
View Full Code Here

    for (int i = 0, size = directories == null ? 0 : directories.size(); i < size; i++)
    {
      String dir = directories.get(i).getAbsolutePath();
      if (name.startsWith(dir))
      {
        return new LocalFile(FileUtil.openFile(dir));
      }
    }
    // return new LocalFile(FileUtil.openFile(f.getParent()));
    return null;
  }
View Full Code Here

            {
                File file = FileUtil.openFile(directory, relativePath);

                if ((file != null) && file.exists())
                {
                    return new LocalFile(file);
                }
            }
        }

        return null;
View Full Code Here

                                          String[] locales, String namespaceURI, String localPart)
        throws CompilerException
    {
        Source s1, s2, s3;
        VirtualFile o1, o2, o3;
        ResourceFile rf1, rf2, rf3;

        s1 = (sourceList != null) ? sourceList.findSource(namespaceURI, localPart) : null;
        o1 = (s1 != null) ? s1.getBackingFile() : null;

        // already compiled. return...
        if (o1 instanceof InMemoryFile)
        {
            return findResourceBundleHelper(sources, s1);
        }

        rf1 = (ResourceFile) o1;

        if (rf1 != null && rf1.complete())
        {
            return findResourceBundleHelper(sources, s1);
        }
        else
        {
            // rf1 == null || !rf1.complete(), must get rf2...
            s2 = (sourcePath != null) ? sourcePath.findSource(namespaceURI, localPart) : null;
            o2 = (s2 != null) ? s2.getBackingFile() : null;

            // already compiled. return...
            if (rf1 == null && o2 instanceof InMemoryFile)
            {
                return findResourceBundleHelper(sources, s2);
            }
            else if (o2 instanceof InMemoryFile)
            {
                o2 = null;
            }

            rf2 = (ResourceFile) o2;

            if (rf1 != null)
            {
                rf1.merge(rf2);
            }
            else
            {
                rf1 = rf2;
                s1 = s2;
            }
        }

        if (rf1 != null && rf1.complete())
        {
            return findResourceBundleHelper(sources, s1);
        }
        else
        {
            // rf1 == null || !rf1.complete(), must get rf3...
            s3 = (swcContext != null) ? swcContext.getResourceBundle(locales, namespaceURI, localPart) : null;
            o3 = (s3 != null) ? s3.getBackingFile() : null;

            // already compiled. return...
            if (rf1 == null && o3 instanceof InMemoryFile)
            {
                return findResourceBundleHelper(sources, s3);
            }
            else if (o3 instanceof InMemoryFile)
            {
                o3 = null;
            }

            rf3 = (ResourceFile) o3;

            if (rf1 != null)
            {
                rf1.merge(rf3);
            }
            else
            {
                rf1 = rf3;
                s1 = s3;
View Full Code Here

                                          String[] locales, String namespaceURI, String localPart)
        throws CompilerException
    {
        Source s1, s2, s3;
        VirtualFile o1, o2, o3;
        ResourceFile rf1, rf2, rf3;

        s1 = (sourceList != null) ? sourceList.findSource(namespaceURI, localPart) : null;
        o1 = (s1 != null) ? s1.getBackingFile() : null;

        // already compiled. return...
        if (o1 instanceof InMemoryFile)
        {
            return findResourceBundleHelper(sources, s1);
        }

        rf1 = (ResourceFile) o1;

        if (rf1 != null && rf1.complete())
        {
            return findResourceBundleHelper(sources, s1);
        }
        else
        {
            // rf1 == null || !rf1.complete(), must get rf2...
            s2 = (sourcePath != null) ? sourcePath.findSource(namespaceURI, localPart) : null;
            o2 = (s2 != null) ? s2.getBackingFile() : null;

            // already compiled. return...
            if (rf1 == null && o2 instanceof InMemoryFile)
            {
                return findResourceBundleHelper(sources, s2);
            }
            else if (o2 instanceof InMemoryFile)
            {
                o2 = null;
            }

            rf2 = (ResourceFile) o2;

            if (rf1 != null)
            {
                rf1.merge(rf2);
            }
            else
            {
                rf1 = rf2;
                s1 = s2;
            }
        }

        if (rf1 != null && rf1.complete())
        {
            return findResourceBundleHelper(sources, s1);
        }
        else
        {
            // rf1 == null || !rf1.complete(), must get rf3...
            s3 = (swcContext != null) ? swcContext.getResourceBundle(locales, namespaceURI, localPart) : null;
            o3 = (s3 != null) ? s3.getBackingFile() : null;

            // already compiled. return...
            if (rf1 == null && o3 instanceof InMemoryFile)
            {
                return findResourceBundleHelper(sources, s3);
            }
            else if (o3 instanceof InMemoryFile)
            {
                o3 = null;
            }

            rf3 = (ResourceFile) o3;

            if (rf1 != null)
            {
                rf1.merge(rf3);
            }
            else
            {
                rf1 = rf3;
                s1 = s3;
View Full Code Here

      Source s = sources.get(bundleName);

      writeU32(out, addString(pool, bundleName));
      writeU32(out, addString(pool, s.getName()));
     
      ResourceFile rf = (ResourceFile) s.getBackingFile();
      VirtualFile[] rFiles = rf.getResourceFiles();
      VirtualFile[] rRoots = rf.getResourcePathRoots();

      writeU32(out, rFiles.length);     
      for (int j = 0, size = rFiles.length; j < size; j++)
      {
        writeU32(out, addString(pool, rFiles[j] != null ? rFiles[j].getName() : "null"));
View Full Code Here

TOP

Related Classes of flex2.compiler.io.ResourceFile

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.