Example #1
0
  /** @param args the command line arguments */
  public static void main(String[] args) {

    //
    LOGGER.log(Level.INFO, "Fiala  starting...");
    System.out.println("Active dir: \t\t\t" + System.getProperty("user.dir"));
    System.out.println(
        "Resource login.conf URL: \t" + Fiala.class.getResource("login.conf").toString());
    System.out.println("Active user: \t\t" + fiala.Utils.ActiveUser());
    System.out.println("DB driver name: \t\t" + PROPERTIES.getProperty("DB_DRIVER"));
    System.out.println("DB URL: \t\t\t" + PROPERTIES.getProperty("DB_URL"));

    System.out.println(
        finale.Utils.YearFrac(Date.getValueOf(1, 1, 2010), Date.getValueOf(1, 1, 2011), ACT_ACT));
  }
 @Override
 public Builder<P> configure(OperationContext context, ModelNode model)
     throws OperationFailedException {
   this.module =
       ModelNodes.asModuleIdentifier(MODULE.getDefinition().resolveModelAttribute(context, model));
   String binding =
       ModelNodes.asString(SOCKET_BINDING.getDefinition().resolveModelAttribute(context, model));
   if (binding != null) {
     this.socketBinding =
         new InjectedValueDependency<>(
             SocketBinding.JBOSS_BINDING_NAME.append(binding), SocketBinding.class);
   }
   for (Property property :
       ModelNodes.asPropertyList(
           PROPERTIES.getDefinition().resolveModelAttribute(context, model))) {
     this.properties.put(property.getName(), property.getValue().asString());
   }
   return this;
 }
  private static String getClasspath(String projectLocation) {
    String classpath = null;

    if (classpaths.containsKey(projectLocation)) {
      classpath = classpaths.get(projectLocation);
    } else {
      String dependencies[] = getDependencies(projectLocation);

      char colon = (Character) PROPERTIES.get("colon");

      classpath = projectLocation + "/bin";

      if (dependencies != null) {
        for (String dependency : dependencies) {
          classpath += colon + dependency;
        }
      }

      classpaths.put(projectLocation, classpath);
    }

    return classpath;
  }
Example #4
0
  private void layoutButtons() {
    int offset = 0;

    if (PROPERTIES.get("os.name").equals("macosx")) {
      if (closeButton != null && closeButton.isVisible()) {
        closeButton.setLocation(offset, 0);

        offset += getHeight() + 1;
      }
      if (minimizeButton != null && minimizeButton.isVisible()) {
        minimizeButton.setLocation(offset, 0);

        offset += getHeight() + 1;
      }
      if (restoreButton != null && restoreButton.isVisible()) {
        restoreButton.setLocation(offset, 0);

        offset += getHeight() + 1;
      }
    } else {
      if (closeButton != null && closeButton.isVisible()) {
        closeButton.setLocation(getWidth() - closeButton.getSize().x - offset, 0);

        offset += getHeight() + 1 + closeButton.getSize().x;
      }
      if (restoreButton != null && restoreButton.isVisible()) {
        restoreButton.setLocation(getWidth() - offset, 0);

        offset += getHeight() + 1;
      }
      if (minimizeButton != null && minimizeButton.isVisible()) {
        minimizeButton.setLocation(getWidth() - offset, 0);

        offset += getHeight() + 1;
      }
    }
  }
 public RelaxedSftpConsumerTest(String name) {
   super(name);
   if (PROPERTIES.getProperty(BASE_DIR_KEY) != null) {
     setBaseDir(PROPERTIES.getProperty(BASE_DIR_KEY));
   }
 }
 protected boolean areTestsEnabled() {
   return Boolean.parseBoolean(PROPERTIES.getProperty("ftp.tests.enabled", "false"));
 }
 @Override
 public void reload() throws IOException {
   ZipFile zipFile;
   if (this.file == null) {
     zipFile = ((JarURLConnection) this.url.openConnection()).getJarFile();
   } else {
     zipFile = new ZipFile(this.file);
   }
   // collect the relevant entries
   Map<ResourceKind, Map<String, ZipEntry>> zipEntryMap =
       new EnumMap<ResourceKind, Map<String, ZipEntry>>(ResourceKind.class);
   for (ResourceKind kind : ResourceKind.values()) {
     zipEntryMap.put(kind, new HashMap<String, ZipEntry>());
   }
   ZipEntry properties = null;
   for (Enumeration<? extends ZipEntry> entries = zipFile.entries(); entries.hasMoreElements(); ) {
     ZipEntry entry = entries.nextElement();
     String entryName = entry.getName();
     int entryPrefixLength = this.entryName.length() + 1;
     if (entryName.startsWith(this.entryName) && entryName.length() > entryPrefixLength) {
       // strip off prefix + 1 to take case of file separator
       String restName = entryName.substring(entryPrefixLength);
       // find out the resource kind by testing the extension
       ResourceKind kind = null;
       for (ResourceKind tryKind : ResourceKind.values()) {
         if (restName.endsWith(tryKind.getFileType().getExtension())) {
           kind = tryKind;
           break;
         }
       }
       if (kind == PROPERTIES) {
         String propertiesName = PROPERTIES.getFileType().stripExtension(restName);
         if (propertiesName.equals(Groove.PROPERTY_NAME)) {
           // preferably take the one with the default name
           properties = entry;
         } else if (properties == null && propertiesName.equals(this.grammarName)) {
           // otherwise, take the one with the grammar name
           properties = entry;
         }
       } else if (kind == null) {
         // must be a layout file
         if (LAYOUT.hasExtension(restName)) {
           String objectName = LAYOUT.stripExtension(restName);
           this.layoutEntryMap.put(objectName, entry);
         }
       } else {
         Object oldEntry = zipEntryMap.get(kind).put(restName, entry);
         assert oldEntry == null
             : String.format("Duplicate %s name '%s'", kind.getName(), restName);
       }
     }
   }
   // now process the entries
   // first load the properties, as they are necessary for loading types
   loadProperties(zipFile, properties);
   for (ResourceKind kind : ResourceKind.values()) {
     if (kind.isTextBased()) {
       loadTexts(kind, zipFile, zipEntryMap.get(kind));
     } else if (kind.isGraphBased()) {
       loadGraphs(kind, zipFile, zipEntryMap.get(kind));
     }
   }
   zipFile.close();
   notify(EnumSet.allOf(ResourceKind.class));
   this.initialised = true;
 }