All Downloads are FREE. Search and download functionalities are using the official Maven repository.

lrgs.ldds.CmdSendSearchCrit Maven / Gradle / Ivy

Go to download

A collection of software for aggregatting and processing environmental data such as from NOAA GOES satellites.

The newest version!
package lrgs.ldds;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

import ilex.util.Logger;

import lrgs.common.*;

/**
  This command sends a search criteria file back to the client.
*/
public class CmdSendSearchCrit extends LddsCommand
{
	/** return "CmdSendSearchCrit"; */
	public String cmdType()
	{
		return "CmdSendSearchCrit";
	}

	/**
	  Executes the command.
	  @param ldds the server thread object holding connection to client.
	*/
	public int execute(LddsThread ldds)
		throws ArchiveException, IOException
	{
		if (ldds.user == null)
			throw new UnknownUserException(
				"Login required before send searchcrit");
		byte scdata[];
		File scfile = new File(ldds.user.directory.getCanonicalPath()
			+ File.separator + "searchcrit");
		try
		{
			FileInputStream fis = new FileInputStream(scfile);

			scdata = new byte[50+(int)scfile.length()];
			byte fnbytes[] = SearchCriteria.defaultName.getBytes();
			for(int i=0; i




© 2015 - 2024 Weber Informatics LLC | Privacy Policy