Package flex2.compiler.io

Examples of flex2.compiler.io.VirtualFile


            // TODO ideally, we could just convert this in-place to a ClassNode for downstream processing
            // Good example of why an explicit type descriptor enum is generally more useful than subclassing
            node.setName(classQName);

            // Create a new Source for the node.
            VirtualFile virtualFile = new TextFile("", unit.getSource().getName() + "$" + className,
                                                   unit.getSource().getName(), unit.getSource().getParent(),
                                                  MimeMappings.MXML, unit.getSource().getLastModified());
            Source source = new Source(virtualFile, unit.getSource(), className, false, false);

            // Set the Source's syntax tree to the DocumentNode
View Full Code Here


    if (targetFile == null)
    {
          throw new ConfigurationException.MustSpecifyTarget( null, null, -1);
    }

        VirtualFile virt = getVirtualFile(targetFile);
        if (virt == null && checkTargetFileInFileSystem())
        {
            throw new ConfigurationException.IOError(targetFile);
        }
  }
View Full Code Here

    public TranscodingResults doTranscode(PathResolver context,
            SymbolTable symbolTable, Map<String, Object> args,
            String className, boolean generateSource)
            throws TranscoderException
    {
        VirtualFile source = resolveSource(context, args);

        // Create ByteArray subclass
        String byteArrayClassName = className + "ByteArray";
        args.put(NEWNAME, byteArrayClassName);
        TranscodingResults byteArrayResults = dataTranscoder.doTranscode(context,
View Full Code Here

    {
        if (files.containsKey(name))
        {
            throw new ConfigurationException.RedundantFile(name, cfgval.getVar(), cfgval.getSource(), cfgval.getLine() );
        }
        VirtualFile f = ConfigurationPathResolver.getVirtualFile( path, configResolver, cfgval );
        files.put(name, f);
    }
View Full Code Here

    {
        if (stylesheets.containsKey(name))
        {
            throw new ConfigurationException.RedundantFile(name, cfgval.getVar(), cfgval.getSource(), cfgval.getLine() );
        }
        VirtualFile f = ConfigurationPathResolver.getVirtualFile( path, configResolver, cfgval );
        stylesheets.put(name, f);
    }
View Full Code Here

    {
        for (Iterator iterator = files.entrySet().iterator(); iterator.hasNext();)
        {
            Map.Entry entry = (Map.Entry)iterator.next();
            String fileName = (String)entry.getKey();
            VirtualFile f = (VirtualFile)entry.getValue();
            if (swc.getArchive().getFile( fileName ) == null)   // icons were already added, don't overwrite
            {
                try
                {
                    VirtualFile swcFile = new InMemoryFile(f.getInputStream(), fileName,
                                                           f.getMimeType(), f.getLastModified());
                    swc.addFile(swcFile);
                }
                catch (IOException ioException)
                {
View Full Code Here

        CompilerContext context = new CompilerContext();

        CompilationUnit cssCompilationUnit = source.newCompilationUnit(null, context);

        VirtualFile generatedFile = generateSourceCodeFile(cssCompilationUnit, styleModule);

        Source generatedSource = new Source(generatedFile, source);

        // when building a SWC, we want to locate all the asset sources and ask compc to put them in the SWC.
        Collection<AtEmbed> atEmbeds = styleModule.getAtEmbeds();
View Full Code Here

      {
            zos = new ZipOutputStream(out);

            for (Iterator<VirtualFile> it = files.values().iterator(); it.hasNext(); )
            {
                VirtualFile f = it.next();

                ZipEntry entry = new ZipEntry( f.getName() );
                entry.setTime(f.getLastModified());
                zos.putNextEntry( entry );

                BufferedInputStream in = new BufferedInputStream(f.getInputStream());
                FileUtil.streamOutput(in, zos);
                zos.closeEntry();
            }

            zos.flush();
View Full Code Here

            {
                SwcGroup tmpThemeGroup = swcCache.getSwcGroup( new VirtualFile[] {themeFiles[i] } );
                groupList.add( tmpThemeGroup );
                for (Iterator it = tmpThemeGroup.getFiles().values().iterator(); it.hasNext();)
                {
                    VirtualFile f = (VirtualFile) it.next();
                  ts.append(f.getLastModified());
                    if (f.getName().endsWith( DOT_CSS ))
                        themeStyles.add( f );
                }
            }
        }
View Full Code Here

    for (Iterator i = files.keySet().iterator(); format != null && i.hasNext();)
    {
      String name = (String) i.next();
      if (name.startsWith("locale/"))
      {
        VirtualFile file = (VirtualFile) files.get(name);
        int prefixLength = "locale/".length(), index = name.indexOf('/', prefixLength);
        String mimeType = file.getMimeType();
        if (index != -1 && format.isSupported(mimeType))
        {
          String locale = name.substring(prefixLength, index);
          String ext = MimeMappings.getExtension(mimeType);
          QName rbName = new QName(NameFormatter.toColon(name.substring(index + 1, name.length() - ext.length()).replace('/', '.')));
View Full Code Here

TOP

Related Classes of flex2.compiler.io.VirtualFile

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.